Skip to content

Commit fb2f0c4

Browse files
committed
fix
1 parent 8082f02 commit fb2f0c4

File tree

6 files changed

+85
-63
lines changed

6 files changed

+85
-63
lines changed

packages/css/test/instance/css.test.js

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { render } from '@testing-library/react'
55
import { css as differentCss, flush, sheet } from './emotion-instance'
66

77
describe('css', () => {
8-
test('float property', async () => {
8+
test('float property', () => {
99
const cls1 = differentCss`
1010
float: left;
1111
`
@@ -14,7 +14,7 @@ describe('css', () => {
1414
expect(container.firstChild).toMatchSnapshot()
1515
})
1616

17-
test('handles more than 10 dynamic properties', async () => {
17+
test('handles more than 10 dynamic properties', () => {
1818
const cls1 = differentCss`
1919
text-decoration: ${'underline'};
2020
border-right: solid blue 54px;
@@ -33,12 +33,12 @@ describe('css', () => {
3333
expect(container.firstChild).toMatchSnapshot()
3434
})
3535

36-
test('falsy value in nested selector on object', async () => {
36+
test('falsy value in nested selector on object', () => {
3737
const cls1 = differentCss({ ':hover': { display: null, color: 'hotpink' } })
3838
const { container } = render(<div className={cls1} />)
3939
expect(container.firstChild).toMatchSnapshot()
4040
})
41-
test('boolean as value', async () => {
41+
test('boolean as value', () => {
4242
const cls1 = differentCss({
4343
display: 'flex',
4444
color: false,
@@ -47,13 +47,13 @@ describe('css', () => {
4747
const { container } = render(<div className={cls1} />)
4848
expect(container.firstChild).toMatchSnapshot()
4949
})
50-
test('auto px', async () => {
50+
test('auto px', () => {
5151
const cls1 = differentCss({ display: 'flex', flex: 1, fontSize: 10 })
5252
const { container } = render(<div className={cls1} />)
5353
expect(container.firstChild).toMatchSnapshot()
5454
})
5555

56-
test('random interpolation with undefined values', async () => {
56+
test('random interpolation with undefined values', () => {
5757
const cls2 = differentCss`
5858
${undefined};
5959
justify-content: center;
@@ -62,7 +62,7 @@ describe('css', () => {
6262
expect(container.firstChild).toMatchSnapshot()
6363
})
6464

65-
test('random expression', async () => {
65+
test('random expression', () => {
6666
const cls2 = differentCss`
6767
font-size: 20px;
6868
@media (min-width: 420px) {
@@ -79,7 +79,7 @@ describe('css', () => {
7979
expect(container.firstChild).toMatchSnapshot()
8080
})
8181

82-
test('simple composition', async () => {
82+
test('simple composition', () => {
8383
const cls1 = differentCss`
8484
display: flex;
8585
&:hover {
@@ -94,7 +94,7 @@ describe('css', () => {
9494
expect(container.firstChild).toMatchSnapshot()
9595
})
9696

97-
test('handles objects', async () => {
97+
test('handles objects', () => {
9898
const cls1 = differentCss({
9999
float: 'left',
100100
display: 'flex',
@@ -107,19 +107,19 @@ describe('css', () => {
107107
expect(container.firstChild).toMatchSnapshot()
108108
})
109109

110-
test('handles array of objects', async () => {
110+
test('handles array of objects', () => {
111111
const cls1 = differentCss([{ height: 50, width: 20 }, null])
112112
const { container } = render(<div className={cls1} />)
113113
expect(container.firstChild).toMatchSnapshot()
114114
})
115115

116-
test('computed key is only dynamic', async () => {
116+
test('computed key is only dynamic', () => {
117117
const cls1 = differentCss({ fontSize: 10, [`w${'idth'}`]: 20 })
118118
const { container } = render(<div className={cls1} />)
119119
expect(container.firstChild).toMatchSnapshot()
120120
})
121121

122-
test('composition with objects', async () => {
122+
test('composition with objects', () => {
123123
const cls1 = differentCss({
124124
display: 'flex',
125125
width: 30,
@@ -141,7 +141,7 @@ describe('css', () => {
141141
const { container } = render(<div className={cls2} />)
142142
expect(container.firstChild).toMatchSnapshot()
143143
})
144-
test('@supports', async () => {
144+
test('@supports', () => {
145145
const cls1 = differentCss`
146146
@supports (display: grid) {
147147
display: grid;
@@ -150,7 +150,7 @@ describe('css', () => {
150150
const { container } = render(<div className={cls1} />)
151151
expect(container.firstChild).toMatchSnapshot()
152152
})
153-
test.skip('nested at rules', async () => {
153+
test.skip('nested at rules', () => {
154154
const cls1 = differentCss`
155155
@supports (display: grid) {
156156
display: grid;
@@ -168,7 +168,7 @@ describe('css', () => {
168168
const { container } = render(<div className={cls1} />)
169169
expect(container.firstChild).toMatchSnapshot()
170170
})
171-
test('nested array', async () => {
171+
test('nested array', () => {
172172
const cls1 = differentCss([
173173
[{ display: 'inline' }],
174174
[{ display: 'inline-block' }],
@@ -193,25 +193,25 @@ describe('css', () => {
193193
expect(container.firstChild).toMatchSnapshot()
194194
})
195195

196-
test('explicit false', async () => {
196+
test('explicit false', () => {
197197
const cls1 = differentCss(false)
198198
const { container } = render(<div className={cls1} />)
199199
expect(container.firstChild).toMatchSnapshot()
200200
})
201201

202-
test('array with explicit false', async () => {
202+
test('array with explicit false', () => {
203203
const cls1 = differentCss([[{ display: 'flex' }], false])
204204
const { container } = render(<div className={cls1} />)
205205
expect(container.firstChild).toMatchSnapshot()
206206
})
207207

208-
test('array with explicit true', async () => {
208+
test('array with explicit true', () => {
209209
const cls1 = differentCss([[{ display: 'flex' }], true])
210210
const { container } = render(<div className={cls1} />)
211211
expect(container.firstChild).toMatchSnapshot()
212212
})
213213

214-
test('nested', async () => {
214+
test('nested', () => {
215215
const cls1 = differentCss`
216216
color: yellow;
217217
& .some-class {
@@ -234,7 +234,7 @@ describe('css', () => {
234234

235235
expect(container.firstChild).toMatchSnapshot()
236236
})
237-
test('explicit &', async () => {
237+
test('explicit &', () => {
238238
flush()
239239
const cls1 = differentCss`
240240
&.another-class {
@@ -247,32 +247,32 @@ describe('css', () => {
247247
expect(sheet).toMatchSnapshot()
248248
flush()
249249
})
250-
test('falsy property value in object', async () => {
250+
test('falsy property value in object', () => {
251251
const cls = differentCss({ display: 'flex', backgroundColor: undefined })
252252
const { container } = render(<div className={cls} />)
253253
expect(container.firstChild).toMatchSnapshot()
254254
})
255-
test('registered styles as nested selector value in object', async () => {
255+
test('registered styles as nested selector value in object', () => {
256256
const cls = differentCss({ display: 'flex', backgroundColor: 'hotpink' })
257257
const cls1 = differentCss({ ':hover': cls })
258258
const { container } = render(<div className={cls1} />)
259259
expect(container.firstChild).toMatchSnapshot()
260260
})
261-
test('composition stuff', async () => {
261+
test('composition stuff', () => {
262262
const cls1 = differentCss({ justifyContent: 'center' })
263263
const cls2 = differentCss([cls1])
264264
const { container: container1 } = render(<div className={cls1} />)
265265
expect(container1.firstChild).toMatchSnapshot()
266266
const { container: container2 } = render(<div className={cls2} />)
267267
expect(container2.firstChild).toMatchSnapshot()
268268
})
269-
test('null rule', async () => {
269+
test('null rule', () => {
270270
const cls1 = differentCss()
271271

272272
const { container } = render(<div className={cls1} />)
273273
expect(container.firstChild).toMatchSnapshot()
274274
})
275-
test('css variables', async () => {
275+
test('css variables', () => {
276276
const cls1 = differentCss`
277277
--some-var: 1px;
278278
width: var(--some-var);
@@ -281,7 +281,7 @@ describe('css', () => {
281281
expect(container.firstChild).toMatchSnapshot()
282282
})
283283

284-
test('null value', async () => {
284+
test('null value', () => {
285285
const cls1 = differentCss(null)
286286
const cls2 = differentCss`
287287
${null};
@@ -294,7 +294,7 @@ describe('css', () => {
294294
).toMatchSnapshot()
295295
})
296296

297-
test('flushes correctly', async () => {
297+
test('flushes correctly', () => {
298298
const cls1 = differentCss`
299299
display: flex;
300300
`
@@ -304,7 +304,7 @@ describe('css', () => {
304304
const { container: container2 } = render(<div className={cls1} />)
305305
expect(container2.firstChild).toMatchSnapshot()
306306
})
307-
test('media query specificity', async () => {
307+
test('media query specificity', () => {
308308
flush()
309309
const cls = differentCss`
310310
width: 32px;
@@ -322,7 +322,7 @@ describe('css', () => {
322322
expect(container.firstChild).toMatchSnapshot()
323323
flush()
324324
})
325-
test('weakmap', async () => {
325+
test('weakmap', () => {
326326
const styles = { display: 'flex' }
327327
const cls1 = differentCss(styles)
328328
const cls2 = differentCss(styles)
@@ -332,7 +332,7 @@ describe('css', () => {
332332
expect(container2.firstChild).toMatchSnapshot()
333333
})
334334

335-
test('manually use label property', async () => {
335+
test('manually use label property', () => {
336336
flush()
337337
const cls1 = differentCss`
338338
color: hotpink;
@@ -342,7 +342,7 @@ describe('css', () => {
342342
expect(container.firstChild).toMatchSnapshot()
343343
expect(sheet).toMatchSnapshot()
344344
})
345-
test('sets correct nonce value', async () => {
345+
test('sets correct nonce value', () => {
346346
flush()
347347
differentCss`
348348
color: hotpink;

packages/styled/__tests__/styled.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ describe('styled', () => {
196196
background-color: green;
197197
}
198198
`
199-
const { container } = render(<Input value="hello world" />)
199+
const { container } = render(
200+
<Input value="hello world" onChange={() => {}} />
201+
)
200202

201203
expect(container.firstChild).toMatchSnapshot()
202204
})
@@ -208,7 +210,9 @@ describe('styled', () => {
208210
}
209211
})
210212

211-
const { container } = render(<Input value="hello world" />)
213+
const { container } = render(
214+
<Input value="hello world" onChange={() => {}} />
215+
)
212216

213217
expect(container.firstChild).toMatchSnapshot()
214218
})

packages/styled/test/__snapshots__/prop-filtering.test.js.snap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
exports[`composes shouldForwardProp on composed styled components 1`] = `
44
<div
55
class="emotion-0 emotion-1"
6+
xyz="true"
67
/>
78
`;
89

@@ -99,6 +100,8 @@ exports[`prop filtering on composed styled components that are string tags 1`] =
99100
data-wow="value"
100101
for="other reasons"
101102
href="link"
103+
is="true"
104+
kind="true"
102105
>
103106
hello world
104107
</a>
@@ -122,6 +125,7 @@ exports[`withComponent inherits explicit shouldForwardProp 1`] = `
122125
123126
<span
124127
class="emotion-0 emotion-1"
128+
foo="true"
125129
/>
126130
`;
127131

@@ -133,6 +137,7 @@ exports[`withComponent inherits explicit shouldForwardProp from flattened compon
133137
134138
<span
135139
class="emotion-0 emotion-1"
140+
foo="true"
136141
/>
137142
`;
138143

@@ -143,6 +148,7 @@ exports[`withComponent should accept shouldForwardProp 1`] = `
143148
144149
<span
145150
class="emotion-0 emotion-1"
151+
xyz="true"
146152
/>
147153
`;
148154

@@ -153,6 +159,8 @@ exports[`withComponent should compose shouldForwardProp 1`] = `
153159
154160
<span
155161
class="emotion-0 emotion-1"
162+
qwe="true"
163+
xyz="true"
156164
/>
157165
`;
158166

@@ -163,5 +171,7 @@ exports[`withComponent should compose shouldForwardProp with a flattened compone
163171
164172
<span
165173
class="emotion-0 emotion-1"
174+
qwe="true"
175+
xyz="true"
166176
/>
167177
`;

packages/styled/test/babel-plugin.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { act } from 'react'
44
import { render } from '@testing-library/react'
55
import styled from '@emotion/styled'
66

7-
test("config merging works even if it's referenced by variable", async () => {
7+
test("config merging works even if it's referenced by variable", () => {
88
const Button = ({ isRed, ...rest }) => (
99
<button {...rest}>{isRed ? 'forwarded' : 'not forwarded'}</button>
1010
)

packages/styled/test/index.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ describe('styled', () => {
154154
background-color: green;
155155
}
156156
`
157-
const { container } = render(<Input value="hello world" />)
157+
const { container } = render(
158+
<Input value="hello world" onChange={() => {}} />
159+
)
158160

159161
expect(container.firstChild).toMatchSnapshot()
160162
})
@@ -166,7 +168,9 @@ describe('styled', () => {
166168
}
167169
})
168170

169-
const { container } = render(<Input value="hello world" />)
171+
const { container } = render(
172+
<Input value="hello world" onChange={() => {}} />
173+
)
170174

171175
expect(container.firstChild).toMatchSnapshot()
172176
})

0 commit comments

Comments
 (0)