-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #751 from hms-dbmi-cellenics/1902-clean-up-v1-expe…
…riments-redux 1902 clean up v1 redux
- Loading branch information
Showing
86 changed files
with
271 additions
and
957 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,6 @@ import fetchMock, { enableFetchMocks } from 'jest-fetch-mock'; | |
import mockAPI, { | ||
} from '__test__/test-utils/mockAPI'; | ||
|
||
import config from 'config'; | ||
import { api } from 'utils/constants'; | ||
|
||
import ShareExperimentModal from 'components/data-management/ShareExperimentModal'; | ||
|
||
jest.mock('@aws-amplify/auth', () => ({ | ||
|
@@ -96,28 +93,4 @@ describe('Share expeirment modal', () => { | |
await act(() => userEvent.click(revokeButton[0])); | ||
await waitFor(() => expect(onCancel).toHaveBeenCalled()); | ||
}); | ||
|
||
it('Inviting users works for v2', async () => { | ||
config.currentApiVersion = api.V2; | ||
|
||
await renderShareExperimentModal(); | ||
const input = screen.getAllByRole('combobox'); | ||
userEvent.type(input[0], '[email protected]{enter}'); | ||
|
||
await waitFor(() => expect(screen.getByText('Add')).toBeInTheDocument()); | ||
const inviteButton = screen.getByText('Add'); | ||
await act(() => fireEvent.click(inviteButton)); | ||
expect(fetchMock.mock.calls.length).toEqual(2); | ||
expect(fetchMock.mock.calls[1]).toMatchSnapshot(); | ||
}); | ||
|
||
it('Revoke access works for v2', async () => { | ||
config.currentApiVersion = api.V2; | ||
|
||
await renderShareExperimentModal(); | ||
const revokeButton = screen.getAllByText('Revoke'); | ||
expect(screen.getByText('[email protected]')).toBeInTheDocument(); | ||
await act(() => userEvent.click(revokeButton[0])); | ||
await waitFor(() => expect(onCancel).toHaveBeenCalled()); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.