Skip to content

Commit 7020d50

Browse files
authored
refactor: remove emotion from tests and utils (#5769)
* refactor: remove emotion from tests and utils * fix: typecheck * fix: tests
1 parent 0405707 commit 7020d50

File tree

118 files changed

+796
-53226
lines changed

Some content is hidden

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

118 files changed

+796
-53226
lines changed

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

Lines changed: 2 additions & 7 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
@@ -90,7 +85,7 @@ 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"
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1+
import type { theme as UVTheme } from '@ultraviolet/themes'
12
import {
23
consoleDarkerTheme,
34
consoleDarkTheme,
45
consoleLightTheme,
56
} from '@ultraviolet/themes'
6-
import { shouldMatchEmotionSnapshot } from '@utils/test'
7+
import { shouldMatchSnapshot } from '@utils/test'
78
import { describe, it } from 'vitest'
89
import { DynamicIllustration } from '..'
910

1011
describe('dynamicIllustration', () => {
1112
it('should work with consoleLightTheme', () =>
12-
shouldMatchEmotionSnapshot(
13+
shouldMatchSnapshot(
1314
<DynamicIllustration name="empty" />,
14-
consoleLightTheme,
15+
consoleLightTheme as typeof UVTheme,
1516
))
1617
it('should work with consoleDarkTheme', () =>
17-
shouldMatchEmotionSnapshot(
18+
shouldMatchSnapshot(
1819
<DynamicIllustration name="empty" />,
19-
consoleDarkTheme,
20+
consoleDarkTheme as typeof UVTheme,
2021
))
2122

2223
it('should work with consoleDarkerTheme', () =>
23-
shouldMatchEmotionSnapshot(
24+
shouldMatchSnapshot(
2425
<DynamicIllustration name="empty" />,
25-
consoleDarkerTheme,
26+
consoleDarkerTheme as typeof UVTheme,
2627
))
2728
})

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"

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

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

55
describe('conversation', () => {
66
it('should work with Default', () =>
7-
shouldMatchEmotionSnapshot(
7+
shouldMatchSnapshot(
88
<Conversation>
99
<Conversation.Date>2022-03-02</Conversation.Date>
1010
<Conversation.Message align="left" avatar={<div>Hello</div>}>

packages/plus/src/components/EstimateCost/__tests__/CustomUnitInput.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { screen, waitFor } from '@testing-library/react'
22
import { userEvent } from '@testing-library/user-event'
3-
import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test'
3+
import { renderWithTheme, shouldMatchSnapshot } from '@utils/test'
44
import {
55
resetIntersectionMocking,
66
setupIntersectionMocking,
@@ -16,7 +16,7 @@ describe('estimateCost - CustomUnitInput', () => {
1616
resetIntersectionMocking()
1717
})
1818
test('render default values', () =>
19-
shouldMatchEmotionSnapshot(
19+
shouldMatchSnapshot(
2020
<CustomUnitInput
2121
iteration={{ unit: 'hours', value: 1 }}
2222
setIteration={() => {}}

packages/plus/src/components/EstimateCost/__tests__/Item.test.tsx

Lines changed: 6 additions & 6 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 {
33
resetIntersectionMocking,
44
setupIntersectionMocking,
@@ -25,7 +25,7 @@ describe('estimateCost - Item', () => {
2525
})
2626

2727
test('render with tabulation', () => {
28-
shouldMatchEmotionSnapshot(
28+
shouldMatchSnapshot(
2929
<EstimateCost>
3030
<EstimateCost.Item label="Test" tabulation={2}>
3131
<EstimateCost.Strong>Test</EstimateCost.Strong>
@@ -35,7 +35,7 @@ describe('estimateCost - Item', () => {
3535
})
3636

3737
test('render with labelTextVariant', () => {
38-
shouldMatchEmotionSnapshot(
38+
shouldMatchSnapshot(
3939
<EstimateCost>
4040
<EstimateCost.Item label="Test" labelTextVariant="bodySmall">
4141
<EstimateCost.Strong>Test</EstimateCost.Strong>
@@ -45,7 +45,7 @@ describe('estimateCost - Item', () => {
4545
})
4646

4747
test('render with priceText', () => {
48-
shouldMatchEmotionSnapshot(
48+
shouldMatchSnapshot(
4949
<EstimateCost>
5050
<EstimateCost.Item label="Test" priceText="included">
5151
<EstimateCost.Strong>Test</EstimateCost.Strong>
@@ -55,7 +55,7 @@ describe('estimateCost - Item', () => {
5555
})
5656

5757
test('render with tooltipInfo', () => {
58-
shouldMatchEmotionSnapshot(
58+
shouldMatchSnapshot(
5959
<EstimateCost>
6060
<EstimateCost.Item label="Test" tooltipInfo="This is a tooltip">
6161
<EstimateCost.Strong>Test</EstimateCost.Strong>
@@ -65,7 +65,7 @@ describe('estimateCost - Item', () => {
6565
})
6666

6767
test('render with notice', () => {
68-
shouldMatchEmotionSnapshot(
68+
shouldMatchSnapshot(
6969
<EstimateCost>
7070
<EstimateCost.Item label="Test" notice="This is a notice">
7171
<EstimateCost.Strong>Test</EstimateCost.Strong>

packages/plus/src/components/EstimateCost/__tests__/Regular.test.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { screen, waitFor } from '@testing-library/react'
22
import { userEvent } from '@testing-library/user-event'
3-
import { renderWithTheme, shouldMatchEmotionSnapshot } from '@utils/test'
3+
import { renderWithTheme, shouldMatchSnapshot } from '@utils/test'
44
import {
55
resetIntersectionMocking,
66
setupIntersectionMocking,
@@ -20,7 +20,7 @@ describe('estimateCost - Regular Item', () => {
2020
})
2121

2222
test('render basic props', () =>
23-
shouldMatchEmotionSnapshot(
23+
shouldMatchSnapshot(
2424
<EstimateCost description="Custom Description">
2525
<EstimateCost.Item label="Regular">
2626
<EstimateCost.Regular>This is a regular Item</EstimateCost.Regular>
@@ -29,7 +29,7 @@ describe('estimateCost - Regular Item', () => {
2929
))
3030

3131
test('render basic props with overlay', () =>
32-
shouldMatchEmotionSnapshot(
32+
shouldMatchSnapshot(
3333
<EstimateCost
3434
OverlayLeft={OverlaySubmitButton}
3535
OverlayRight={OverlaySubmitButton}
@@ -48,7 +48,7 @@ describe('estimateCost - Regular Item', () => {
4848
))
4949

5050
test('render basic props with overlay beta', () =>
51-
shouldMatchEmotionSnapshot(
51+
shouldMatchSnapshot(
5252
<EstimateCost isBeta OverlayRight={OverlaySubmitButton}>
5353
<EstimateCost.Item
5454
amount={0}
@@ -67,7 +67,7 @@ describe('estimateCost - Regular Item', () => {
6767
))
6868

6969
test('render basic props with long fractions digits', () =>
70-
shouldMatchEmotionSnapshot(
70+
shouldMatchSnapshot(
7171
<EstimateCost>
7272
<EstimateCost.Item label="Regular" longFractionDigits price={0.000001}>
7373
<EstimateCost.Regular>This is a regular Item</EstimateCost.Regular>
@@ -76,7 +76,7 @@ describe('estimateCost - Regular Item', () => {
7676
))
7777

7878
test('render basic props with maxPrice and longFractionDigits', () =>
79-
shouldMatchEmotionSnapshot(
79+
shouldMatchSnapshot(
8080
<EstimateCost>
8181
<EstimateCost.Item
8282
amount={10}
@@ -91,7 +91,7 @@ describe('estimateCost - Regular Item', () => {
9191
))
9292

9393
test('render basic props with maxPrice', () =>
94-
shouldMatchEmotionSnapshot(
94+
shouldMatchSnapshot(
9595
<EstimateCost>
9696
<EstimateCost.Item
9797
amount={0}
@@ -106,7 +106,7 @@ describe('estimateCost - Regular Item', () => {
106106
))
107107

108108
test('render basic props with is not defined', () =>
109-
shouldMatchEmotionSnapshot(
109+
shouldMatchSnapshot(
110110
<EstimateCost>
111111
<EstimateCost.Item isDefined={false} label="Regular">
112112
<EstimateCost.Regular>This is a regular Item</EstimateCost.Regular>
@@ -115,7 +115,7 @@ describe('estimateCost - Regular Item', () => {
115115
))
116116

117117
test('render basic props with sublabel', () =>
118-
shouldMatchEmotionSnapshot(
118+
shouldMatchSnapshot(
119119
<EstimateCost>
120120
<EstimateCost.Item label="Regular" subLabel="Excellent">
121121
<EstimateCost.Regular>This is a regular Item</EstimateCost.Regular>
@@ -124,7 +124,7 @@ describe('estimateCost - Regular Item', () => {
124124
))
125125

126126
test('render basic props with textNotDefined', () =>
127-
shouldMatchEmotionSnapshot(
127+
shouldMatchSnapshot(
128128
<EstimateCost>
129129
<EstimateCost.Item label="Regular" textNotDefined="Not defined">
130130
<EstimateCost.Regular>This is a regular Item</EstimateCost.Regular>
@@ -133,7 +133,7 @@ describe('estimateCost - Regular Item', () => {
133133
))
134134

135135
test('render basic with ellipsis', () =>
136-
shouldMatchEmotionSnapshot(
136+
shouldMatchSnapshot(
137137
<EstimateCost>
138138
<EstimateCost.Item label="Regular" textNotDefined="Not defined">
139139
<EstimateCost.Regular>
@@ -146,7 +146,7 @@ describe('estimateCost - Regular Item', () => {
146146
))
147147

148148
test('render with isDisabledOnOverlay', () =>
149-
shouldMatchEmotionSnapshot(
149+
shouldMatchSnapshot(
150150
<EstimateCost>
151151
<EstimateCost.Item label="Regular">
152152
<EstimateCost.Regular isDisabledOnOverlay>
@@ -157,7 +157,7 @@ describe('estimateCost - Regular Item', () => {
157157
))
158158

159159
test('render with alert', () =>
160-
shouldMatchEmotionSnapshot(
160+
shouldMatchSnapshot(
161161
<EstimateCost
162162
alert="this is an alert"
163163
alertTitle="this is an alert title"

0 commit comments

Comments
 (0)