Skip to content

Commit

Permalink
✅ Update mixins test
Browse files Browse the repository at this point in the history
  • Loading branch information
exah committed Dec 26, 2018
1 parent ef2ed48 commit 3dc4306
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions test/styled-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,21 @@ describe('mixin', () => {
`

test('prop', () => {
const tree = toJSON(h(Box, { theme, bg: 'red' }))
const tree = toJSON(h(Box, { theme, bg: 'red', fg: 'red' }))
expect(tree).toHaveStyleRule('background-color', 'red')
expect(tree).toHaveStyleRule('color', 'red')
expect(tree).not.toHaveStyleRule('border-color')
})

test('mq', () => {
const tree = toJSON(h(Box, { theme, bg: 'red' }))
const tree = toJSON(h(Box, { theme }))
expect(tree).toHaveStyleRule('background-color', 'black', { media: theme.media.sm })
})

test('themePath', () => {
expect(toJSON(h(Box, { theme, fg: 'red' }))).toHaveStyleRule('color', 'red')
})

test('fallbacks', () => {
expect(toJSON(h(Box, { theme }))).toHaveStyleRule('background-color', 'blue')
expect(toJSON(h(Box, { theme }))).toHaveStyleRule('color', '#0000FF')
expect(toJSON(h(Box, { theme }))).toMatchSnapshot()
const tree = toJSON(h(Box, { theme }))
expect(tree).toHaveStyleRule('background-color', 'blue')
expect(tree).toHaveStyleRule('color', '#0000FF')
expect(tree).toMatchSnapshot()
})
})

0 comments on commit 3dc4306

Please sign in to comment.