-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathindex.spec.jsx
More file actions
47 lines (36 loc) · 1.01 KB
/
index.spec.jsx
File metadata and controls
47 lines (36 loc) · 1.01 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
import 'react-dom'
import renderer from 'react-test-renderer'
import React from 'react'
import styled, {Styled, injectStyled} from '../'
import CreateApp from './App'
it('renders correctly App with default styled', () => {
const App = CreateApp(styled)
const tree = renderer.create(<App />).toJSON()
expect(tree).toMatchSnapshot()
})
it('renders correctly App with default Styled', () => {
const customStyled = Styled({
baseButton: {
color: 'red',
},
})
const App = CreateApp(customStyled)
const tree = renderer.create(<App />).toJSON()
expect(tree).toMatchSnapshot()
})
it('renders correctly App with injectStyled', () => {
const customStyled = Styled({
root: {
fontSize: 16
},
baseButton: {
color: 'red',
},
})
const App = CreateApp(customStyled)
const StyledApp = injectStyled(customStyled)(({classes}) => (
<div className={classes.root}><App /></div>
))
const tree = renderer.create(<StyledApp />).toJSON()
expect(tree).toMatchSnapshot()
})