modules/core/utils/withThemeProviders.js   A
last analyzed

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 28
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 16
mnd 0
bc 0
fnc 4
dl 0
loc 28
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
rs 10
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