Total Complexity | 4 |
Complexity/F | 1 |
Lines of Code | 28 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { shallow, mount } from 'enzyme' |
||
2 | import { ThemeConsumer } from 'styled-components/macro' |
||
3 | import homeTheme from '~/modules/core/theme/styleguide/theme' |
||
4 | import baseTheme from '~/modules/core/theme/styleguide/baseTheme' |
||
5 | |||
6 | /* istanbul ignore next */ |
||
7 | export const shallowWithTheme = (children, theme = homeTheme) => { |
||
8 | ThemeConsumer._currentValue = theme |
||
9 | return shallow(children) |
||
10 | } |
||
11 | |||
12 | /* istanbul ignore next */ |
||
13 | export const shallowWithDivingTheme = (children, theme = homeTheme) => { |
||
14 | ThemeConsumer._currentValue = theme |
||
15 | return shallow(children).dive() |
||
16 | } |
||
17 | |||
18 | /* istanbul ignore next */ |
||
19 | export const mountWithTheme = (children, theme = homeTheme) => { |
||
20 | ThemeConsumer._currentValue = theme |
||
21 | return mount(children) |
||
22 | } |
||
23 | |||
24 | /* istanbul ignore next */ |
||
25 | export const shallowWithBaseTheme = (children, theme = baseTheme) => { |
||
26 | ThemeConsumer._currentValue = theme |
||
27 | return shallow(children) |
||
28 | } |
||
29 |