Skip to content

Commit 16c2eb5

Browse files
committed
refactor: remove emotion from tests and utils
1 parent 29df8eb commit 16c2eb5

File tree

134 files changed

+1172
-53566
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+1172
-53566
lines changed

packages/form/src/components/CheckboxField/__tests__/__snapshots__/index.test.tsx.snap

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ exports[`checkboxField > should render correctly 1`] = `
3232
<rect
3333
class="uv_9pjq8o1"
3434
height="16"
35-
rx="0.125rem"
35+
rx="var(--rwwhsl88)"
3636
stroke-width="2"
3737
width="16"
3838
x="4"
@@ -89,7 +89,7 @@ exports[`checkboxField > should render correctly checked without value 1`] = `
8989
<rect
9090
class="uv_9pjq8o1"
9191
height="16"
92-
rx="0.125rem"
92+
rx="var(--rwwhsl88)"
9393
stroke-width="2"
9494
width="16"
9595
x="4"
@@ -146,7 +146,7 @@ exports[`checkboxField > should render correctly disabled 1`] = `
146146
<rect
147147
class="uv_9pjq8o1"
148148
height="16"
149-
rx="0.125rem"
149+
rx="var(--rwwhsl88)"
150150
stroke-width="2"
151151
width="16"
152152
x="4"
@@ -202,7 +202,7 @@ exports[`checkboxField > should render correctly not checked without value 1`] =
202202
<rect
203203
class="uv_9pjq8o1"
204204
height="16"
205-
rx="0.125rem"
205+
rx="var(--rwwhsl88)"
206206
stroke-width="2"
207207
width="16"
208208
x="4"
@@ -259,7 +259,7 @@ exports[`checkboxField > should render correctly with aria-label 1`] = `
259259
<rect
260260
class="uv_9pjq8o1"
261261
height="16"
262-
rx="0.125rem"
262+
rx="var(--rwwhsl88)"
263263
stroke-width="2"
264264
width="16"
265265
x="4"
@@ -316,7 +316,7 @@ exports[`checkboxField > should render correctly with errors 1`] = `
316316
<rect
317317
class="uv_9pjq8o1"
318318
height="16"
319-
rx="0.125rem"
319+
rx="var(--rwwhsl88)"
320320
stroke-width="2"
321321
width="16"
322322
x="4"
@@ -396,7 +396,7 @@ exports[`checkboxField > should trigger events correctly 1`] = `
396396
<rect
397397
class="uv_9pjq8o1"
398398
height="16"
399-
rx="0.125rem"
399+
rx="var(--rwwhsl88)"
400400
stroke-width="2"
401401
width="16"
402402
x="4"

packages/form/src/components/CheckboxGroupField/__tests__/__snapshots__/index.test.tsx.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ exports[`checkboxField > should render correctly checked 1`] = `
5454
<rect
5555
class="uv_9pjq8o1"
5656
height="16"
57-
rx="0.125rem"
57+
rx="var(--rwwhsl88)"
5858
stroke-width="2"
5959
width="16"
6060
x="4"
@@ -113,7 +113,7 @@ exports[`checkboxField > should render correctly checked 1`] = `
113113
<rect
114114
class="uv_9pjq8o1"
115115
height="16"
116-
rx="0.125rem"
116+
rx="var(--rwwhsl88)"
117117
stroke-width="2"
118118
width="16"
119119
x="4"
@@ -220,7 +220,7 @@ exports[`checkboxField > should trigger events correctly with required prop 1`]
220220
<rect
221221
class="uv_9pjq8o1"
222222
height="16"
223-
rx="0.125rem"
223+
rx="var(--rwwhsl88)"
224224
stroke-width="2"
225225
width="16"
226226
x="4"
@@ -279,7 +279,7 @@ exports[`checkboxField > should trigger events correctly with required prop 1`]
279279
<rect
280280
class="uv_9pjq8o1"
281281
height="16"
282-
rx="0.125rem"
282+
rx="var(--rwwhsl88)"
283283
stroke-width="2"
284284
width="16"
285285
x="4"

packages/form/src/components/SelectableCardGroupField/__tests__/__snapshots__/index.test.tsx.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ exports[`selectableCardField > should render correctly checked as a checkbox 1`]
226226
<rect
227227
class="uv_9pjq8o1"
228228
height="16"
229-
rx="0.125rem"
229+
rx="var(--rwwhsl88)"
230230
stroke-width="2"
231231
width="16"
232232
x="4"
@@ -434,7 +434,7 @@ exports[`selectableCardField > should trigger events correctly 1`] = `
434434
<rect
435435
class="uv_9pjq8o1"
436436
height="16"
437-
rx="0.125rem"
437+
rx="var(--rwwhsl88)"
438438
stroke-width="2"
439439
width="16"
440440
x="4"
@@ -505,7 +505,7 @@ exports[`selectableCardField > should trigger events correctly 1`] = `
505505
<rect
506506
class="uv_9pjq8o1"
507507
height="16"
508-
rx="0.125rem"
508+
rx="var(--rwwhsl88)"
509509
stroke-width="2"
510510
width="16"
511511
x="4"

packages/form/src/components/SliderField/__tests__/__snapshots__/index.test.tsx.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ exports[`sliderField > should render correctly 1`] = `
4141
min="0"
4242
name="test"
4343
step="1"
44-
style="--uv_a5ifr12: calc(0% - 8px); --uv_a5ifr11: #ffffff; background-size: 0% 100%;"
44+
style="--uv_a5ifr12: calc(0% - 8px); --uv_a5ifr11: var(--rwwhsl1n); background-size: 0% 100%;"
4545
tabindex="0"
4646
type="range"
4747
value="0"
@@ -98,7 +98,7 @@ exports[`sliderField > should render correctly disabled 1`] = `
9898
min="0"
9999
name="test"
100100
step="1"
101-
style="--uv_a5ifr12: calc(0% - 8px); --uv_a5ifr11: #ffffff; background-size: 0% 100%;"
101+
style="--uv_a5ifr12: calc(0% - 8px); --uv_a5ifr11: var(--rwwhsl1n); background-size: 0% 100%;"
102102
tabindex="0"
103103
type="range"
104104
value="0"
@@ -152,7 +152,7 @@ exports[`sliderField > should render correctly with possible values 1`] = `
152152
min="0"
153153
name="test"
154154
step="1"
155-
style="--uv_a5ifr12: calc(0% - 8px); --uv_a5ifr11: #ffffff; background-size: 0% 100%;"
155+
style="--uv_a5ifr12: calc(0% - 8px); --uv_a5ifr11: var(--rwwhsl1n); background-size: 0% 100%;"
156156
tabindex="0"
157157
type="range"
158158
value="0"
@@ -323,7 +323,7 @@ exports[`sliderField > should render correctly with possible values and double 1
323323
min="0"
324324
name="test"
325325
step="1"
326-
style="--uv_a5ifr12: calc(0% - 8px; --uv_a5ifr11: #ffffff;"
326+
style="--uv_a5ifr12: calc(0% - 8px; --uv_a5ifr11: var(--rwwhsl1n);"
327327
type="range"
328328
value="0"
329329
/>
@@ -337,7 +337,7 @@ exports[`sliderField > should render correctly with possible values and double 1
337337
min="0"
338338
name="test"
339339
step="1"
340-
style="--uv_a5ifr12: calc(100% - 8px; --uv_a5ifr11: #ffffff;"
340+
style="--uv_a5ifr12: calc(100% - 8px; --uv_a5ifr11: var(--rwwhsl1n);"
341341
type="range"
342342
value="6"
343343
/>
@@ -531,7 +531,7 @@ exports[`sliderField > should trigger events correctly 1`] = `
531531
min="0"
532532
name="test"
533533
step="1"
534-
style="--uv_a5ifr12: calc(0% - 8px); --uv_a5ifr11: #ffffff; background-size: 0% 100%;"
534+
style="--uv_a5ifr12: calc(0% - 8px); --uv_a5ifr11: var(--rwwhsl1n); background-size: 0% 100%;"
535535
tabindex="0"
536536
type="range"
537537
value="0"

packages/form/src/components/Submit/__tests__/__snapshots__/index.test.tsx.snap

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,7 @@ exports[`submit > form is invalid 1`] = `
5353

5454
exports[`submit > form is submitting 1`] = `
5555
<DocumentFragment>
56-
.emotion-0 {
57-
-webkit-transition: stroke-dashoffset 0.5s ease 0s;
58-
transition: stroke-dashoffset 0.5s ease 0s;
59-
}
60-
61-
<div
56+
<div
6257
data-testid="testing"
6358
>
6459
<form
@@ -78,7 +73,7 @@ exports[`submit > form is submitting 1`] = `
7873
aria-valuetext="20%"
7974
class="uv_tkulld2"
8075
role="progressbar"
81-
style="height: 1rem; width: 1rem;"
76+
style="height: var(--rwwhsl9c); width: var(--rwwhsl9c);"
8277
viewBox="0 0 100 100"
8378
>
8479
<circle
@@ -90,12 +85,12 @@ exports[`submit > form is submitting 1`] = `
9085
stroke-width="16"
9186
/>
9287
<circle
93-
class="emotion-0"
88+
class="uv_tkulld3"
9489
cx="50"
9590
cy="50"
9691
fill="none"
9792
r="42"
98-
stroke="#ffffff"
93+
stroke="var(--rwwhsl4r)"
9994
stroke-dasharray="263.89378290154264"
10095
stroke-dashoffset="211.11502632123413"
10196
stroke-linecap="round"

packages/form/src/components/TextAreaField/__tests__/__snapshots__/index.test.tsx.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ exports[`textAreaField > should render correctly 1`] = `
2727
id="_r_0_"
2828
name="test"
2929
rows="3"
30-
style="--uv_hlf4vn0: calc(1.5rem + 0px + 0px);"
30+
style="--uv_hlf4vn0: calc(var(--rwwhsl9w) + 0px + 0px);"
3131
/>
3232
<div
3333
class="uv_hlf4vn2 uv_toi52u0 uv_toi52u3d uv_toi52u2j uv_toi52u7d uv_toi52u7 uv_toi52u5d"
@@ -75,7 +75,7 @@ exports[`textAreaField > should render correctly generated 1`] = `
7575
id="_r_7_"
7676
name="test"
7777
rows="3"
78-
style="--uv_hlf4vn0: calc(1.5rem + 300px + 0px);"
78+
style="--uv_hlf4vn0: calc(var(--rwwhsl9w) + 300px + 0px);"
7979
>
8080
This is an example
8181
</textarea>
@@ -137,7 +137,7 @@ exports[`textAreaField > should submit with onSubmitEnter prop 1`] = `
137137
id="_r_3_"
138138
name="test"
139139
rows="3"
140-
style="--uv_hlf4vn0: calc(1.5rem + 0px + 0px);"
140+
style="--uv_hlf4vn0: calc(var(--rwwhsl9w) + 0px + 0px);"
141141
>
142142
This is an example
143143
</textarea>

packages/form/src/hooks/__tests__/useOnFieldChange.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { ThemeProvider } from '@emotion/react'
21
import { renderHook } from '@testing-library/react'
2+
import { ThemeProvider } from '@ultraviolet/themes'
33
import { theme as lightTheme } from '@ultraviolet/ui'
44
import type { ReactNode } from 'react'
55
import { useForm } from 'react-hook-form'

packages/illustrations/src/components/DynamicIllustration/__tests__/index.test.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,21 @@ import {
33
consoleDarkTheme,
44
consoleLightTheme,
55
} from '@ultraviolet/themes'
6-
import { shouldMatchEmotionSnapshot } from '@utils/test'
6+
import { shouldMatchSnapshot } from '@utils/test'
77
import { describe, it } from 'vitest'
88
import { DynamicIllustration } from '..'
99

1010
describe('dynamicIllustration', () => {
1111
it('should work with consoleLightTheme', () =>
12-
shouldMatchEmotionSnapshot(
12+
shouldMatchSnapshot(
1313
<DynamicIllustration name="empty" />,
1414
consoleLightTheme,
1515
))
1616
it('should work with consoleDarkTheme', () =>
17-
shouldMatchEmotionSnapshot(
18-
<DynamicIllustration name="empty" />,
19-
consoleDarkTheme,
20-
))
17+
shouldMatchSnapshot(<DynamicIllustration name="empty" />, consoleDarkTheme))
2118

2219
it('should work with consoleDarkerTheme', () =>
23-
shouldMatchEmotionSnapshot(
20+
shouldMatchSnapshot(
2421
<DynamicIllustration name="empty" />,
2522
consoleDarkerTheme,
2623
))

packages/plus/src/components/CodeEditor/__tests__/index.test.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { shouldMatchEmotionSnapshot } from '@utils/test'
1+
import { shouldMatchSnapshot } from '@utils/test'
22
import { describe, it } from 'vitest'
33
import { CodeEditor } from '../CodeEditor'
44

@@ -8,7 +8,7 @@ import { CodeEditor } from '../CodeEditor'
88
// library.
99
describe.skip('codeEditor', () => {
1010
it('should render correctly with content', () =>
11-
shouldMatchEmotionSnapshot(
11+
shouldMatchSnapshot(
1212
<CodeEditor
1313
extensions="yaml"
1414
height="600px"
@@ -21,7 +21,7 @@ describe.skip('codeEditor', () => {
2121
))
2222

2323
it('should render correctly with label', () =>
24-
shouldMatchEmotionSnapshot(
24+
shouldMatchSnapshot(
2525
<CodeEditor
2626
extensions="yaml"
2727
height="600px"
@@ -33,7 +33,7 @@ describe.skip('codeEditor', () => {
3333
))
3434

3535
it('should render correctly disbled', () =>
36-
shouldMatchEmotionSnapshot(
36+
shouldMatchSnapshot(
3737
<CodeEditor
3838
disabled
3939
extensions="yaml"
@@ -44,7 +44,7 @@ describe.skip('codeEditor', () => {
4444
))
4545

4646
it('should render correctly with copyButton as boolean', () =>
47-
shouldMatchEmotionSnapshot(
47+
shouldMatchSnapshot(
4848
<CodeEditor
4949
copyButton
5050
extensions="yaml"
@@ -55,7 +55,7 @@ describe.skip('codeEditor', () => {
5555
))
5656

5757
it('should render correctly with copyButton as string', () =>
58-
shouldMatchEmotionSnapshot(
58+
shouldMatchSnapshot(
5959
<CodeEditor
6060
copyButton="Copy"
6161
extensions="yaml"

packages/plus/src/components/ContentCardGroup/__tests__/index.test.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test'
1+
import { renderWithTheme, shouldMatchSnapshot } from '@utils/test'
22
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'
33
import { ContentCardGroup } from '..'
44

@@ -12,14 +12,14 @@ describe('contentCardGroup', () => {
1212
})
1313

1414
test('renders correctly with required title & hread', () =>
15-
shouldMatchEmotionSnapshot(
15+
shouldMatchSnapshot(
1616
<ContentCardGroup>
1717
<ContentCardGroup.Card href="http://scaleway.com" title="title" />
1818
</ContentCardGroup>,
1919
))
2020

2121
test('renders correctly with subtitle', () =>
22-
shouldMatchEmotionSnapshot(
22+
shouldMatchSnapshot(
2323
<ContentCardGroup>
2424
<ContentCardGroup.Card
2525
href="http://scaleway.com"
@@ -30,7 +30,7 @@ describe('contentCardGroup', () => {
3030
))
3131

3232
test('renders correctly with description', () =>
33-
shouldMatchEmotionSnapshot(
33+
shouldMatchSnapshot(
3434
<ContentCardGroup>
3535
<ContentCardGroup.Card
3636
description="description"
@@ -50,7 +50,7 @@ describe('contentCardGroup', () => {
5050
})
5151

5252
test('renders correctly with link target _parent', () =>
53-
shouldMatchEmotionSnapshot(
53+
shouldMatchSnapshot(
5454
<ContentCardGroup>
5555
<ContentCardGroup.Card
5656
href="http://scaleway.com"
@@ -61,7 +61,7 @@ describe('contentCardGroup', () => {
6161
))
6262

6363
test('renders correctly with a children', () =>
64-
shouldMatchEmotionSnapshot(
64+
shouldMatchSnapshot(
6565
<ContentCardGroup>
6666
<ContentCardGroup.Card href="http://scaleway.com" target="_parent">
6767
<div>test</div>
@@ -70,7 +70,7 @@ describe('contentCardGroup', () => {
7070
))
7171

7272
test('renders correctly with different title and subtitle and with custom titleAs and subtitleAs', () =>
73-
shouldMatchEmotionSnapshot(
73+
shouldMatchSnapshot(
7474
<ContentCardGroup>
7575
<ContentCardGroup.Card
7676
href="http://scaleway.com"

0 commit comments

Comments
 (0)