-
Notifications
You must be signed in to change notification settings - Fork 264
Expand file tree
/
Copy pathWindowSideBarInfoPanel.test.jsx
More file actions
35 lines (30 loc) · 1.07 KB
/
WindowSideBarInfoPanel.test.jsx
File metadata and controls
35 lines (30 loc) · 1.07 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
import { render, screen } from '@tests/utils/test-utils';
import { WindowSideBarInfoPanel } from '../../../src/components/WindowSideBarInfoPanel';
/** create wrapper */
function createWrapper(props) {
return render(
<WindowSideBarInfoPanel
id="asdf"
windowId="zxcv"
{...props}
/>,
{ preloadedState: { companionWindows: { asdf: { content: 'info' } } } },
);
}
describe('WindowSideBarInfoPanel', () => {
describe('when metadata is present', () => {
it('renders headers', () => {
createWrapper();
expect(screen.getByRole('heading', { name: 'About this item' })).toBeInTheDocument();
});
it('renders the manifest elements', () => {
createWrapper();
expect(screen.getByRole('heading', { name: 'Resource' })).toBeInTheDocument();
expect(screen.getByRole('heading', { name: 'Related' })).toBeInTheDocument();
});
it('renders the canvas elements', () => {
createWrapper({ canvasIds: ['1', '2'] });
expect(screen.getAllByRole('heading', { name: /(Left|Right)/ }).length).toEqual(2);
});
});
});