Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Dec 4, 2024
1 parent 36ccc7c commit 27452f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/library-authoring/LibraryContent.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { getContentSearchConfigUrl } from '../search-manager/data/api';
import { mockContentLibrary } from './data/api.mocks';
import mockEmptyResult from '../search-modal/__mocks__/empty-search-result.json';
import { LibraryProvider } from './common/context/LibraryContext';
import { SidebarProvider } from './common/context/SidebarContext';
import LibraryContent from './LibraryContent';
import { libraryComponentsMock } from './__mocks__';

Expand Down Expand Up @@ -56,7 +57,11 @@ const clipboardBroadcastChannelMock = {

const withLibraryId = (libraryId: string) => ({
extraWrapper: ({ children }: { children: React.ReactNode }) => (
<LibraryProvider libraryId={libraryId}>{children}</LibraryProvider>
<LibraryProvider libraryId={libraryId}>
<SidebarProvider>
{children}
</SidebarProvider>
</LibraryProvider>
),
});

Expand Down
2 changes: 1 addition & 1 deletion src/library-authoring/components/CollectionCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('<CollectionCard />', () => {
const openMenuItem = screen.getByRole('link', { name: 'Open' });
expect(openMenuItem).toBeInTheDocument();

expect(openMenuItem).toHaveAttribute('href', '/library/lb:org1:Demo_Course/collection/collection-display-name/');
expect(openMenuItem).toHaveAttribute('href', '/library/lb:org1:Demo_Course/collection/collection-display-name');
});

it('should show confirmation box, delete collection and show toast to undo deletion', async () => {
Expand Down

0 comments on commit 27452f7

Please sign in to comment.