forked from zoltantothcom/Design-Patterns-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbout.test.js
More file actions
31 lines (29 loc) · 841 Bytes
/
About.test.js
File metadata and controls
31 lines (29 loc) · 841 Bytes
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
import React from 'react';
import renderer from 'react-test-renderer';
import 'jest-styled-components';
import { ThemeProvider } from 'styled-components';
import { themeLight } from '../../src/styles/themes/theme.light';
import { themeDark } from '../../src/styles/themes/theme.dark';
import About from '../../src/pages/About';
describe('About page', () => {
it('renders with a LIGHT theme', () => {
const tree = renderer
.create(
<ThemeProvider theme={themeLight}>
<About />
</ThemeProvider>
)
.toJSON();
expect(tree).toMatchSnapshot();
});
it('renders with a DARK theme', () => {
const tree = renderer
.create(
<ThemeProvider theme={themeDark}>
<About />
</ThemeProvider>
)
.toJSON();
expect(tree).toMatchSnapshot();
});
});