@@ -25,7 +25,7 @@ describe('Themr decorator function', () => {
25
25
}
26
26
27
27
it ( 'passes a context theme object using the component\'s context' , ( ) => {
28
- const theme = { Container : { foo : 'foo_1234' } } ;
28
+ const theme = { Container : { foo : 'foo_1234' } }
29
29
30
30
@themr ( 'Container' )
31
31
class Container extends Component {
@@ -45,8 +45,8 @@ describe('Themr decorator function', () => {
45
45
} )
46
46
47
47
it ( 'passes a context theme object using the component\'s theme prop' , ( ) => {
48
- const containerTheme = { foo : 'foo_1234' } ;
49
- const theme = { Container : containerTheme } ;
48
+ const containerTheme = { foo : 'foo_1234' }
49
+ const theme = { Container : containerTheme }
50
50
51
51
@themr ( 'Container' )
52
52
class Container extends Component {
@@ -62,14 +62,14 @@ describe('Themr decorator function', () => {
62
62
)
63
63
64
64
const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough )
65
- expect ( stub . props . theme ) . toEqual ( containerTheme ) ;
65
+ expect ( stub . props . theme ) . toEqual ( containerTheme )
66
66
} )
67
67
68
68
it ( 'passes a theme composed from context, local and props' , ( ) => {
69
- const containerTheme = { foo : 'foo_123' } ;
70
- const containerThemeLocal = { foo : 'foo_567' } ;
71
- const containerThemeProps = { foo : 'foo_89' } ;
72
- const theme = { Container : containerTheme } ;
69
+ const containerTheme = { foo : 'foo_123' }
70
+ const containerThemeLocal = { foo : 'foo_567' }
71
+ const containerThemeProps = { foo : 'foo_89' }
72
+ const theme = { Container : containerTheme }
73
73
74
74
@themr ( 'Container' , containerThemeLocal )
75
75
class Container extends Component {
@@ -84,15 +84,15 @@ describe('Themr decorator function', () => {
84
84
</ ProviderMock >
85
85
)
86
86
87
- const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough ) ;
88
- const expectedTheme = { foo : 'foo_123 foo_567 foo_89' } ;
89
- expect ( stub . props . theme ) . toEqual ( expectedTheme ) ;
87
+ const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough )
88
+ const expectedTheme = { foo : 'foo_123 foo_567 foo_89' }
89
+ expect ( stub . props . theme ) . toEqual ( expectedTheme )
90
90
} )
91
91
92
92
it ( 'passes a default theme when composition is disabled and with no props' , ( ) => {
93
- const containerTheme = { foo : 'foo_123' } ;
94
- const containerThemeLocal = { foo : 'foo_567' } ;
95
- const theme = { Container : containerTheme } ;
93
+ const containerTheme = { foo : 'foo_123' }
94
+ const containerThemeLocal = { foo : 'foo_567' }
95
+ const theme = { Container : containerTheme }
96
96
97
97
@themr ( 'Container' , containerThemeLocal , { composeTheme : false } )
98
98
class Container extends Component {
@@ -107,14 +107,14 @@ describe('Themr decorator function', () => {
107
107
</ ProviderMock >
108
108
)
109
109
110
- const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough ) ;
111
- expect ( stub . props . theme ) . toEqual ( containerThemeLocal ) ;
110
+ const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough )
111
+ expect ( stub . props . theme ) . toEqual ( containerThemeLocal )
112
112
} )
113
113
114
114
it ( 'when providing decorator options composes a theme object deeply' , ( ) => {
115
- const containerTheme = { foo : 'foo_123' } ;
116
- const containerTheme2 = { foo : 'foo_567' } ;
117
- const theme = { Container : containerTheme } ;
115
+ const containerTheme = { foo : 'foo_123' }
116
+ const containerTheme2 = { foo : 'foo_567' }
117
+ const theme = { Container : containerTheme }
118
118
119
119
@themr ( 'Container' )
120
120
class Container extends Component {
@@ -129,15 +129,15 @@ describe('Themr decorator function', () => {
129
129
</ ProviderMock >
130
130
)
131
131
132
- const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough ) ;
133
- const expectedTheme = { foo : 'foo_123 foo_567' } ;
134
- expect ( stub . props . theme ) . toEqual ( expectedTheme ) ;
135
- } ) ;
132
+ const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough )
133
+ const expectedTheme = { foo : 'foo_123 foo_567' }
134
+ expect ( stub . props . theme ) . toEqual ( expectedTheme )
135
+ } )
136
136
137
137
it ( 'when providing decorator options composes a theme object softly' , ( ) => {
138
- const containerTheme = { foo : 'foo_123' , bar : 'bar_765' } ;
139
- const containerTheme2 = { foo : 'foo_567' } ;
140
- const theme = { Container : containerTheme } ;
138
+ const containerTheme = { foo : 'foo_123' , bar : 'bar_765' }
139
+ const containerTheme2 = { foo : 'foo_567' }
140
+ const theme = { Container : containerTheme }
141
141
142
142
@themr ( 'Container' , null , { composeTheme : 'softly' } )
143
143
class Container extends Component {
@@ -152,15 +152,15 @@ describe('Themr decorator function', () => {
152
152
</ ProviderMock >
153
153
)
154
154
155
- const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough ) ;
156
- const expectedTheme = { foo : 'foo_567' , bar : 'bar_765' } ;
157
- expect ( stub . props . theme ) . toEqual ( expectedTheme ) ;
158
- } ) ;
155
+ const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough )
156
+ const expectedTheme = { foo : 'foo_567' , bar : 'bar_765' }
157
+ expect ( stub . props . theme ) . toEqual ( expectedTheme )
158
+ } )
159
159
160
160
it ( 'when providing decorator options does not compose a theme' , ( ) => {
161
- const containerTheme = { foo : 'foo_123' } ;
162
- const containerTheme2 = { foo : 'foo_567' } ;
163
- const theme = { Container : containerTheme } ;
161
+ const containerTheme = { foo : 'foo_123' }
162
+ const containerTheme2 = { foo : 'foo_567' }
163
+ const theme = { Container : containerTheme }
164
164
165
165
@themr ( 'Container' , null , { composeTheme : false } )
166
166
class Container extends Component {
@@ -175,14 +175,14 @@ describe('Themr decorator function', () => {
175
175
</ ProviderMock >
176
176
)
177
177
178
- const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough ) ;
179
- expect ( stub . props . theme ) . toEqual ( containerTheme2 ) ;
178
+ const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough )
179
+ expect ( stub . props . theme ) . toEqual ( containerTheme2 )
180
180
} )
181
181
182
182
it ( 'when providing props options composes a theme object deeply' , ( ) => {
183
- const containerTheme = { foo : 'foo_123' } ;
184
- const containerTheme2 = { foo : 'foo_567' } ;
185
- const theme = { Container : containerTheme } ;
183
+ const containerTheme = { foo : 'foo_123' }
184
+ const containerTheme2 = { foo : 'foo_567' }
185
+ const theme = { Container : containerTheme }
186
186
187
187
@themr ( 'Container' )
188
188
class Container extends Component {
@@ -197,15 +197,15 @@ describe('Themr decorator function', () => {
197
197
</ ProviderMock >
198
198
)
199
199
200
- const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough ) ;
201
- const expectedTheme = { foo : 'foo_123 foo_567' } ;
202
- expect ( stub . props . theme ) . toEqual ( expectedTheme ) ;
203
- } ) ;
200
+ const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough )
201
+ const expectedTheme = { foo : 'foo_123 foo_567' }
202
+ expect ( stub . props . theme ) . toEqual ( expectedTheme )
203
+ } )
204
204
205
205
it ( 'when providing props options composes a theme object softly' , ( ) => {
206
- const containerTheme = { foo : 'foo_123' , bar : 'bar_765' } ;
207
- const containerTheme2 = { foo : 'foo_567' } ;
208
- const theme = { Container : containerTheme } ;
206
+ const containerTheme = { foo : 'foo_123' , bar : 'bar_765' }
207
+ const containerTheme2 = { foo : 'foo_567' }
208
+ const theme = { Container : containerTheme }
209
209
210
210
@themr ( 'Container' )
211
211
class Container extends Component {
@@ -220,15 +220,15 @@ describe('Themr decorator function', () => {
220
220
</ ProviderMock >
221
221
)
222
222
223
- const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough ) ;
224
- const expectedTheme = { foo : 'foo_567' , bar : 'bar_765' } ;
225
- expect ( stub . props . theme ) . toEqual ( expectedTheme ) ;
226
- } ) ;
223
+ const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough )
224
+ const expectedTheme = { foo : 'foo_567' , bar : 'bar_765' }
225
+ expect ( stub . props . theme ) . toEqual ( expectedTheme )
226
+ } )
227
227
228
228
it ( 'when providing props options does not compose a theme' , ( ) => {
229
- const containerTheme = { foo : 'foo_123' } ;
230
- const containerTheme2 = { foo : 'foo_567' } ;
231
- const theme = { Container : containerTheme } ;
229
+ const containerTheme = { foo : 'foo_123' }
230
+ const containerTheme2 = { foo : 'foo_567' }
231
+ const theme = { Container : containerTheme }
232
232
233
233
@themr ( 'Container' )
234
234
class Container extends Component {
@@ -243,8 +243,8 @@ describe('Themr decorator function', () => {
243
243
</ ProviderMock >
244
244
)
245
245
246
- const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough ) ;
247
- expect ( stub . props . theme ) . toEqual ( containerTheme2 ) ;
246
+ const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough )
247
+ expect ( stub . props . theme ) . toEqual ( containerTheme2 )
248
248
} )
249
249
250
250
it ( 'throws an error if an invalid composition option passed' , ( ) => {
@@ -270,7 +270,7 @@ describe('Themr decorator function', () => {
270
270
< Container />
271
271
)
272
272
273
- const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough ) ;
274
- expect ( stub . props . theme ) . toEqual ( { } ) ;
273
+ const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough )
274
+ expect ( stub . props . theme ) . toEqual ( { } )
275
275
} )
276
276
} )
0 commit comments