From 3dc43068257f6747b313b3c1f438c2c0042ab08c Mon Sep 17 00:00:00 2001 From: John Grishin Date: Thu, 27 Dec 2018 00:30:50 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Update=20mixins=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/styled-components.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/test/styled-components.js b/test/styled-components.js index dab0bd1..0aeb739 100644 --- a/test/styled-components.js +++ b/test/styled-components.js @@ -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() }) })