Skip to content

Commit

Permalink
test(archives): update archive snapshot test
Browse files Browse the repository at this point in the history
  • Loading branch information
tthvo committed Oct 23, 2023
1 parent c863913 commit 5fce17a
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/test/Archives/Archives.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import '@testing-library/jest-dom';
import { MemoryRouter } from 'react-router-dom';

Check warning on line 21 in src/test/Archives/Archives.test.tsx

View workflow job for this annotation

GitHub Actions / eslint-check (16.x)

'MemoryRouter' is defined but never used

Check warning on line 21 in src/test/Archives/Archives.test.tsx

View workflow job for this annotation

GitHub Actions / eslint-check (18.x)

'MemoryRouter' is defined but never used
import renderer, { act } from 'react-test-renderer';

Check warning on line 22 in src/test/Archives/Archives.test.tsx

View workflow job for this annotation

GitHub Actions / eslint-check (16.x)

'renderer' is defined but never used

Check warning on line 22 in src/test/Archives/Archives.test.tsx

View workflow job for this annotation

GitHub Actions / eslint-check (16.x)

'act' is defined but never used

Check warning on line 22 in src/test/Archives/Archives.test.tsx

View workflow job for this annotation

GitHub Actions / eslint-check (18.x)

'renderer' is defined but never used

Check warning on line 22 in src/test/Archives/Archives.test.tsx

View workflow job for this annotation

GitHub Actions / eslint-check (18.x)

'act' is defined but never used
import { of } from 'rxjs';
import { render } from '../utils';
import { render, renderSnapshot } from '../utils';

jest.mock('@app/Recordings/ArchivedRecordingsTable', () => {
return {
Expand Down Expand Up @@ -116,18 +116,7 @@ describe('<Archives />', () => {
});

it('renders correctly', async () => {
let tree;
await act(async () => {
tree = renderer.create(
<ServiceContext.Provider value={defaultServices}>
<NotificationsContext.Provider value={NotificationsInstance}>
<MemoryRouter initialEntries={['/archives']}>
<Archives />
</MemoryRouter>
</NotificationsContext.Provider>
</ServiceContext.Provider>,
);
});
const tree = await renderSnapshot({ routerConfigs: { routes: [{ path: '/archives', element: <Archives /> }] } });
expect(tree?.toJSON()).toMatchSnapshot();
});
});

0 comments on commit 5fce17a

Please sign in to comment.