@@ -18,7 +18,7 @@ expect.extend(matchers)
18
18
test ( 'renders with color modes' , ( ) => {
19
19
let json
20
20
let mode
21
- const Mode = props => {
21
+ const Mode = ( props ) => {
22
22
const [ colorMode ] = useColorMode ( )
23
23
mode = colorMode
24
24
return < div > Mode</ div >
@@ -46,7 +46,7 @@ test('renders with color modes', () => {
46
46
test ( 'renders with initial color mode name' , ( ) => {
47
47
let json
48
48
let mode
49
- const Mode = props => {
49
+ const Mode = ( props ) => {
50
50
const [ colorMode ] = useColorMode ( )
51
51
mode = colorMode
52
52
return < div > Mode</ div >
@@ -71,12 +71,12 @@ test('renders with initial color mode name', () => {
71
71
72
72
test ( 'useColorMode updates color mode state' , ( ) => {
73
73
let mode
74
- const Button = props => {
74
+ const Button = ( props ) => {
75
75
const [ colorMode , setMode ] = useColorMode ( )
76
76
mode = colorMode
77
77
return (
78
78
< button
79
- onClick = { e => {
79
+ onClick = { ( e ) => {
80
80
setMode ( 'dark' )
81
81
} }
82
82
children = "test"
@@ -95,15 +95,15 @@ test('useColorMode updates color mode state', () => {
95
95
96
96
test ( 'color mode is passed through theme context' , ( ) => {
97
97
let mode
98
- const Button = props => {
98
+ const Button = ( props ) => {
99
99
const [ colorMode , setMode ] = useColorMode ( )
100
100
mode = colorMode
101
101
return (
102
102
< button
103
103
sx = { {
104
104
color : 'text' ,
105
105
} }
106
- onClick = { e => {
106
+ onClick = { ( e ) => {
107
107
setMode ( 'dark' )
108
108
} }
109
109
children = "test"
@@ -133,7 +133,7 @@ test('color mode is passed through theme context', () => {
133
133
} )
134
134
135
135
test ( 'converts color modes to css custom properties' , ( ) => {
136
- const Box = props => (
136
+ const Box = ( props ) => (
137
137
< div
138
138
sx = { {
139
139
color : 'text' ,
@@ -164,7 +164,7 @@ test('converts color modes to css custom properties', () => {
164
164
165
165
test ( 'uses default mode' , ( ) => {
166
166
let mode
167
- const Button = props => {
167
+ const Button = ( props ) => {
168
168
const [ colorMode , setMode ] = useColorMode ( )
169
169
mode = colorMode
170
170
return < button children = "test" />
@@ -180,7 +180,7 @@ test('uses default mode', () => {
180
180
test ( 'initializes mode based on localStorage' , ( ) => {
181
181
window . localStorage . setItem ( STORAGE_KEY , 'dark' )
182
182
let mode
183
- const Button = props => {
183
+ const Button = ( props ) => {
184
184
const [ colorMode , setMode ] = useColorMode ( )
185
185
mode = colorMode
186
186
return < button children = "test" />
@@ -195,7 +195,7 @@ test('initializes mode based on localStorage', () => {
195
195
196
196
test ( 'inherits color mode state from parent context' , ( ) => {
197
197
let mode
198
- const Consumer = props => {
198
+ const Consumer = ( props ) => {
199
199
const [ colorMode ] = useColorMode ( )
200
200
mode = colorMode
201
201
return null
@@ -223,7 +223,7 @@ test('inherits color mode state from parent context', () => {
223
223
224
224
test ( 'retains initial context' , ( ) => {
225
225
let context
226
- const Consumer = props => {
226
+ const Consumer = ( props ) => {
227
227
context = useThemeUI ( )
228
228
return null
229
229
}
@@ -237,14 +237,14 @@ test('retains initial context', () => {
237
237
} )
238
238
239
239
test ( 'initializes mode from prefers-color-scheme media query' , ( ) => {
240
- window . matchMedia = jest . fn ( ) . mockImplementation ( query => {
240
+ window . matchMedia = jest . fn ( ) . mockImplementation ( ( query ) => {
241
241
return {
242
242
matches : true ,
243
243
media : query ,
244
244
}
245
245
} )
246
246
let mode
247
- const Consumer = props => {
247
+ const Consumer = ( props ) => {
248
248
const [ colorMode ] = useColorMode ( )
249
249
mode = colorMode
250
250
return null
@@ -261,14 +261,14 @@ test('initializes mode from prefers-color-scheme media query', () => {
261
261
} )
262
262
263
263
test ( 'does not initialize mode from prefers-color-scheme media query' , ( ) => {
264
- window . matchMedia = jest . fn ( ) . mockImplementation ( query => {
264
+ window . matchMedia = jest . fn ( ) . mockImplementation ( ( query ) => {
265
265
return {
266
266
matches : false ,
267
267
media : query ,
268
268
}
269
269
} )
270
270
let mode
271
- const Consumer = props => {
271
+ const Consumer = ( props ) => {
272
272
const [ colorMode ] = useColorMode ( )
273
273
mode = colorMode
274
274
return null
@@ -285,14 +285,14 @@ test('does not initialize mode from prefers-color-scheme media query', () => {
285
285
} )
286
286
287
287
test ( 'does not initialize mode from prefers-color-scheme media query when useColorSchemeMediaQuery is not set' , ( ) => {
288
- window . matchMedia = jest . fn ( ) . mockImplementation ( query => {
288
+ window . matchMedia = jest . fn ( ) . mockImplementation ( ( query ) => {
289
289
return {
290
290
matches : true ,
291
291
media : query ,
292
292
}
293
293
} )
294
294
let mode
295
- const Consumer = props => {
295
+ const Consumer = ( props ) => {
296
296
const [ colorMode ] = useColorMode ( )
297
297
mode = colorMode
298
298
return null
@@ -308,7 +308,7 @@ test('does not initialize mode from prefers-color-scheme media query when useCol
308
308
test ( 'useColorMode throws when there is no theme context' , ( ) => {
309
309
const restore = mockConsole ( )
310
310
expect ( ( ) => {
311
- const Consumer = props => {
311
+ const Consumer = ( props ) => {
312
312
const _ = useColorMode ( 'beep' )
313
313
return null
314
314
}
@@ -372,14 +372,14 @@ test('warns when initialColorModeName matches a key in theme.colors.modes', () =
372
372
} )
373
373
374
374
test ( 'dot notation works with color modes' , ( ) => {
375
- const Button = props => {
375
+ const Button = ( props ) => {
376
376
const [ colorMode , setMode ] = useColorMode ( )
377
377
return (
378
378
< button
379
379
sx = { {
380
380
color : 'header.title' ,
381
381
} }
382
- onClick = { e => {
382
+ onClick = { ( e ) => {
383
383
setMode ( 'dark' )
384
384
} }
385
385
children = "test"
@@ -412,14 +412,14 @@ test('dot notation works with color modes', () => {
412
412
} )
413
413
414
414
test ( 'dot notation works with color modes and custom properties' , ( ) => {
415
- const Button = props => {
415
+ const Button = ( props ) => {
416
416
const [ colorMode , setMode ] = useColorMode ( )
417
417
return (
418
418
< button
419
419
sx = { {
420
420
color : 'header.title' ,
421
421
} }
422
- onClick = { e => {
422
+ onClick = { ( e ) => {
423
423
setMode ( 'dark' )
424
424
} }
425
425
children = "test"
@@ -455,7 +455,7 @@ test('dot notation works with color modes and custom properties', () => {
455
455
456
456
test ( 'raw color values are passed to theme-ui context when custom properties are enabled' , ( ) => {
457
457
let color
458
- const Grabber = props => {
458
+ const Grabber = ( props ) => {
459
459
const context = useThemeUI ( )
460
460
color = context . theme . colors ! . primary
461
461
return null
@@ -486,7 +486,7 @@ test('warns when localStorage is disabled', () => {
486
486
} )
487
487
488
488
let mode
489
- const Consumer = props => {
489
+ const Consumer = ( props ) => {
490
490
const [ colorMode ] = useColorMode ( )
491
491
mode = colorMode
492
492
return null
0 commit comments