-
Notifications
You must be signed in to change notification settings - Fork 284
Expand file tree
/
Copy pathAllRead.test.tsx
More file actions
39 lines (30 loc) · 1.04 KB
/
AllRead.test.tsx
File metadata and controls
39 lines (30 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { act } from '@testing-library/react';
import { renderWithAppContext } from '../__helpers__/test-utils';
import { mockSettings } from '../__mocks__/state-mocks';
import { useFiltersStore } from '../stores';
import { AllRead } from './AllRead';
describe('renderer/components/AllRead.tsx', () => {
it('should render itself & its children - no filters', async () => {
let tree: ReturnType<typeof renderWithAppContext> | null = null;
await act(async () => {
tree = renderWithAppContext(<AllRead />, {
settings: {
...mockSettings,
},
});
});
expect(tree.container).toMatchSnapshot();
});
it('should render itself & its children - with filters', async () => {
useFiltersStore.setState({ reasons: ['author'] });
let tree: ReturnType<typeof renderWithAppContext> | null = null;
await act(async () => {
tree = renderWithAppContext(<AllRead />, {
settings: {
...mockSettings,
},
});
});
expect(tree.container).toMatchSnapshot();
});
});