Skip to content

Commit

Permalink
test: Add test for cancel library create button
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuf-musleh committed Jul 26, 2024
1 parent 983d917 commit e0a3c36
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/library-authoring/create-library/CreateLibrary.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,13 @@ describe('<CreateLibrary />', () => {
expect(getByRole('alert')).toHaveTextContent('{"field":"Error message"}');
});
});

test('cancel creating library navigates to libraries page', async () => {
const { getByRole } = render(<RootWrapper />);

fireEvent.click(getByRole('button', { name: /cancel/i }));
await waitFor(() => {
expect(mockNavigate).toHaveBeenCalledWith('/libraries');
});
});
});

0 comments on commit e0a3c36

Please sign in to comment.