-
Notifications
You must be signed in to change notification settings - Fork 264
Expand file tree
/
Copy pathWindowSideBarAnnotationsPanel.test.jsx
More file actions
48 lines (38 loc) · 1.33 KB
/
WindowSideBarAnnotationsPanel.test.jsx
File metadata and controls
48 lines (38 loc) · 1.33 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
40
41
42
43
44
45
46
47
48
import { render, screen } from '@tests/utils/test-utils';
import CanvasAnnotations from '../../../src/containers/CanvasAnnotations';
import { WindowSideBarAnnotationsPanel } from '../../../src/components/WindowSideBarAnnotationsPanel';
/** */
function createWrapper(props, state) {
return render(
<WindowSideBarAnnotationsPanel
annotationCount={4}
classes={{}}
id="xyz"
windowId="abc"
{...props}
/>,
{ preloadedState: { companionWindows: { xyz: { content: 'annotations' } }, windows: { abc: {} }, ...state } },
);
}
describe('WindowSideBarAnnotationsPanel', () => {
let wrapper;
it('has a heading', () => {
createWrapper();
expect(screen.getByRole('heading')).toHaveTextContent('Annotations');
});
it('has the AnnotationSettings component', () => {
createWrapper();
expect(screen.getByRole('button', { name: 'Highlight all' })).toBeInTheDocument();
});
it('renders the annotationsCount', () => {
createWrapper();
expect(screen.getByText('Showing 4 annotations')).toHaveClass('MuiTypography-subtitle2');
});
// TODO: Requires a lot of state setup...
test.skip('renders a CanvasAnnotations for every selected canvas', () => {
wrapper = createWrapper({
canvasIds: ['abc', 'xyz'],
});
expect(wrapper.find(CanvasAnnotations).length).toBe(2);
});
});