Skip to content

Commit 5d929ae

Browse files
committed
chore: address review comments
1 parent dbf9247 commit 5d929ae

2 files changed

Lines changed: 6 additions & 17 deletions

File tree

src/library-authoring/containers/ContainerRemover.test.tsx

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,22 @@ import {
66
render,
77
screen,
88
waitFor,
9-
} from '../../testUtils';
9+
} from '@src/testUtils';
10+
import { ToastProvider } from '@src/generic/toast-context';
1011
import {
1112
getLibraryContainerChildrenApiUrl,
1213
} from '../data/api';
1314
import {
1415
mockContentLibrary,
15-
mockXBlockFields,
16-
mockGetContainerMetadata,
1716
mockGetContainerChildren,
18-
mockLibraryBlockMetadata,
1917
} from '../data/api.mocks';
20-
import { mockContentSearchConfig, mockGetBlockTypes } from '../../search-manager/data/api.mock';
21-
import { mockClipboardEmpty } from '../../generic/data/api.mock';
22-
import { ToastProvider } from '../../generic/toast-context';
2318
import ContainerRemover from './ContainerRemover';
2419
import { LibraryProvider } from '../common/context/LibraryContext';
2520

2621
let axiosMock: MockAdapter;
2722

28-
mockClipboardEmpty.applyMock();
29-
mockGetContainerMetadata.applyMock();
3023
mockGetContainerChildren.applyMock();
31-
mockContentSearchConfig.applyMock();
32-
mockGetBlockTypes.applyMock();
3324
mockContentLibrary.applyMock();
34-
mockXBlockFields.applyMock();
35-
mockLibraryBlockMetadata.applyMock();
3625

3726
const mockClose = jest.fn();
3827

@@ -76,9 +65,9 @@ describe('<ContainerRemover />', () => {
7665

7766
await waitFor(() => {
7867
expect(axiosMock.history.patch[0].url).toEqual(url);
79-
// Only the first element is removed even though the last element has the same id.
80-
expect(JSON.parse(axiosMock.history.patch[0].data).usage_keys).toEqual(resultIds.slice(1));
8168
});
69+
// Only the first element is removed even though the last element has the same id.
70+
expect(JSON.parse(axiosMock.history.patch[0].data).usage_keys).toEqual(resultIds.slice(1));
8271
expect(mockClose).toHaveBeenCalled();
8372
});
8473
});

src/library-authoring/units/LibraryUnitPage.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,9 @@ describe('<LibraryUnitPage />', () => {
413413

414414
await waitFor(() => {
415415
expect(axiosMock.history.patch[0].url).toEqual(url);
416-
// Only the first element is removed even though the last element has the same id.
417-
expect(JSON.parse(axiosMock.history.patch[0].data).usage_keys).toEqual(resultIds.slice(1));
418416
});
417+
// Only the first element is removed even though the last element has the same id.
418+
expect(JSON.parse(axiosMock.history.patch[0].data).usage_keys).toEqual(resultIds.slice(1));
419419
await waitFor(() => expect(mockShowToast).toHaveBeenCalled());
420420
});
421421

0 commit comments

Comments
 (0)