Navigation: Collapsible section nav implementation (#55995)

* initial collapsible section nav implementation

* fix unit tests

* automatically collapse sectionnav when below lg size

* fix unit tests

* only register 1 event listener each time

* fix display name for SectionNavToggle
This commit is contained in:
Ashley Harrison
2022-10-04 09:19:23 +01:00
committed by GitHub
parent 4087ad413f
commit 317b353b34
5 changed files with 108 additions and 24 deletions

View File

@@ -57,7 +57,7 @@ describe('VersionSettings', () => {
// Need to use delay: null here to work with fakeTimers
// see https://github.com/testing-library/user-event/issues/833
user = userEvent.setup({ delay: null });
jest.resetAllMocks();
jest.clearAllMocks();
jest.useFakeTimers();
});
@@ -103,7 +103,7 @@ describe('VersionSettings', () => {
historySrv.getHistoryList.mockResolvedValue(versions.slice(0, VERSIONS_FETCH_LIMIT - 5));
setup();
expect(screen.queryByRole('button', { name: /show more versions|/i })).not.toBeInTheDocument();
expect(screen.queryByRole('button', { name: /show more versions/i })).not.toBeInTheDocument();
expect(screen.queryByRole('button', { name: /compare versions/i })).not.toBeInTheDocument();
await waitFor(() => expect(screen.getByRole('table')).toBeInTheDocument());