@@ -22,7 +22,7 @@ describe('toHaveStyleRule', () => {
22
22
width : 100% ;
23
23
`
24
24
25
- it ( 'matches styles on the top-most node passed in' , ( ) => {
25
+ test ( 'matches styles on the top-most node passed in' , ( ) => {
26
26
const tree = renderer
27
27
. create (
28
28
< div css = { divStyle } >
@@ -40,7 +40,7 @@ describe('toHaveStyleRule', () => {
40
40
expect ( svgNode ) . not . toHaveStyleRule ( 'color' , 'red' )
41
41
} )
42
42
43
- it ( 'supports asymmetric matchers' , ( ) => {
43
+ test ( 'supports asymmetric matchers' , ( ) => {
44
44
const tree = renderer
45
45
. create (
46
46
< div css = { divStyle } >
@@ -57,14 +57,14 @@ describe('toHaveStyleRule', () => {
57
57
expect ( svgNode ) . toHaveStyleRule ( 'width' , expect . stringMatching ( / .* % $ / ) )
58
58
} )
59
59
60
- it ( 'fails if no styles are found' , ( ) => {
60
+ test ( 'fails if no styles are found' , ( ) => {
61
61
const tree = renderer . create ( < div /> ) . toJSON ( )
62
62
const result = toHaveStyleRule ( tree , 'color' , 'red' )
63
63
expect ( result . pass ) . toBe ( false )
64
64
expect ( result . message ( ) ) . toBe ( 'Property not found: color' )
65
65
} )
66
66
67
- it ( 'supports regex values' , ( ) => {
67
+ test ( 'supports regex values' , ( ) => {
68
68
const tree = renderer . create ( < div css = { divStyle } /> ) . toJSON ( )
69
69
expect ( tree ) . toHaveStyleRule ( 'color' , / r e d / )
70
70
} )
@@ -81,7 +81,7 @@ describe('toHaveStyleRule', () => {
81
81
expect ( resultPass . message ( ) ) . toMatchSnapshot ( )
82
82
} )
83
83
84
- it ( 'matches styles on the focus, hover targets' , ( ) => {
84
+ test ( 'matches styles on the focus, hover targets' , ( ) => {
85
85
const localDivStyle = css `
86
86
color : white;
87
87
& : hover {
@@ -104,7 +104,7 @@ describe('toHaveStyleRule', () => {
104
104
expect ( tree ) . toHaveStyleRule ( 'color' , 'white' )
105
105
} )
106
106
107
- it ( 'matches styles on the nested component or html element' , ( ) => {
107
+ test ( 'matches styles on the nested component or html element' , ( ) => {
108
108
const Svg = styled ( 'svg' ) `
109
109
width: 100%;
110
110
fill: blue;
@@ -134,7 +134,7 @@ describe('toHaveStyleRule', () => {
134
134
expect ( tree ) . toHaveStyleRule ( 'fill' , 'green' , { target : `${ Svg } ` } )
135
135
} )
136
136
137
- it ( 'matches target styles by regex' , ( ) => {
137
+ test ( 'matches target styles by regex' , ( ) => {
138
138
const localDivStyle = css `
139
139
a {
140
140
color : yellow;
@@ -154,7 +154,7 @@ describe('toHaveStyleRule', () => {
154
154
expect ( tree ) . toHaveStyleRule ( 'color' , 'yellow' , { target : / a $ / } )
155
155
} )
156
156
157
- it ( 'matches proper style for css' , ( ) => {
157
+ test ( 'matches proper style for css' , ( ) => {
158
158
const tree = renderer
159
159
. create (
160
160
< div
@@ -169,7 +169,7 @@ describe('toHaveStyleRule', () => {
169
169
expect ( tree ) . toHaveStyleRule ( 'color' , 'hotpink' )
170
170
} )
171
171
172
- it ( 'matches style of the media' , ( ) => {
172
+ test ( 'matches style of the media' , ( ) => {
173
173
const Svg = styled ( 'svg' ) `
174
174
width: 100%;
175
175
`
@@ -212,7 +212,7 @@ describe('toHaveStyleRule', () => {
212
212
} )
213
213
} )
214
214
215
- it ( 'matches styles with target and media options' , ( ) => {
215
+ test ( 'matches styles with target and media options' , ( ) => {
216
216
const localDivStyle = css `
217
217
color : white;
218
218
@media (min-width : 420px ) {
@@ -240,7 +240,7 @@ describe('toHaveStyleRule', () => {
240
240
expect ( tree ) . toHaveStyleRule ( 'color' , 'white' )
241
241
} )
242
242
243
- it ( 'fails if option media invalid' , ( ) => {
243
+ test ( 'fails if option media invalid' , ( ) => {
244
244
const Div = styled ( 'div' ) `
245
245
font-size: 30px;
246
246
@media (min-width: 420px) {
@@ -257,7 +257,7 @@ describe('toHaveStyleRule', () => {
257
257
expect ( result . message ( ) ) . toBe ( 'Property not found: font-size' )
258
258
} )
259
259
260
- it ( 'matches styles for a component used as selector' , ( ) => {
260
+ test ( 'matches styles for a component used as selector' , ( ) => {
261
261
const Bar = styled . div ``
262
262
263
263
const Foo = styled . div `
@@ -278,7 +278,7 @@ describe('toHaveStyleRule', () => {
278
278
expect ( tree . children [ 0 ] ) . toHaveStyleRule ( 'color' , 'hotpink' )
279
279
} )
280
280
281
- it ( 'takes specificity into account when matching styles (basic)' , ( ) => {
281
+ test ( 'takes specificity into account when matching styles (basic)' , ( ) => {
282
282
const Bar = styled . div `
283
283
color : yellow;
284
284
`
@@ -302,7 +302,7 @@ describe('toHaveStyleRule', () => {
302
302
expect ( tree . children [ 0 ] ) . toHaveStyleRule ( 'color' , 'hotpink' )
303
303
} )
304
304
305
- it ( 'should throw a friendly error when it receives an array' , ( ) => {
305
+ test ( 'should throw a friendly error when it receives an array' , ( ) => {
306
306
const tree = renderer
307
307
. create (
308
308
< >
@@ -323,7 +323,7 @@ describe('toHaveStyleRule', () => {
323
323
)
324
324
} )
325
325
; ( isReact16 ? describe : describe . skip ) ( 'enzyme' , ( ) => {
326
- it ( 'supports enzyme `mount` method' , ( ) => {
326
+ test ( 'supports enzyme `mount` method' , ( ) => {
327
327
const Component = ( ) => (
328
328
< div css = { divStyle } >
329
329
< svg css = { svgStyle } />
@@ -338,7 +338,7 @@ describe('toHaveStyleRule', () => {
338
338
expect ( svgNode ) . not . toHaveStyleRule ( 'color' , 'red' )
339
339
} )
340
340
341
- it ( 'supports enzyme `render` method' , ( ) => {
341
+ test ( 'supports enzyme `render` method' , ( ) => {
342
342
const Component = ( ) => (
343
343
< div css = { divStyle } >
344
344
< svg css = { svgStyle } />
@@ -353,7 +353,7 @@ describe('toHaveStyleRule', () => {
353
353
expect ( svgNode ) . not . toHaveStyleRule ( 'color' , 'red' )
354
354
} )
355
355
356
- it ( 'supports enzyme `shallow` method' , ( ) => {
356
+ test ( 'supports enzyme `shallow` method' , ( ) => {
357
357
const Component = ( ) => (
358
358
< div css = { divStyle } >
359
359
< svg css = { svgStyle } />
@@ -368,7 +368,7 @@ describe('toHaveStyleRule', () => {
368
368
expect ( svgNode ) . not . toHaveStyleRule ( 'color' , 'red' )
369
369
} )
370
370
371
- it ( 'supports styled components' , ( ) => {
371
+ test ( 'supports styled components' , ( ) => {
372
372
const Div = styled ( 'div' ) `
373
373
color: red;
374
374
`
0 commit comments