Skip to content

Commit fc1e69b

Browse files
committed
test: fix unit suite snapshots and account for VisuallyHidden being a span
1 parent 8f809af commit fc1e69b

File tree

10 files changed

+62
-178
lines changed

10 files changed

+62
-178
lines changed

.changeset/tasty-suits-sit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
'@strapi/design-system': major
33
---
44

5-
chore: Box/Flex & Typography are now all react components, they are no longer styled-components.
5+
chore: Box/Flex/Grid & Typography are now all react components, they are no longer styled-components.

.changeset/tidy-rats-camp.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@strapi/design-system': major
3+
---
4+
5+
chore: disallow use of as and instead use tag prop instead

docs/stories/Inputs/TextInput.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const WithField = {
7676
return (
7777
<Field id="with_field" error={error} hint={hint}>
7878
<FieldLabel>{label}</FieldLabel>
79-
<TextInput name="content" error={error} {...props} />
79+
<TextInput name="content" {...props} />
8080
<FieldError />
8181
<FieldHint />
8282
</Field>

packages/strapi-design-system/src/Avatar/__tests__/Avatar.test.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ describe('Avatar', () => {
3838
border-radius: 50%;
3939
object-fit: cover;
4040
position: absolute;
41-
-webkit-transform: translate(-16px,-100%);
42-
-ms-transform: translate(-16px,-100%);
43-
transform: translate(-16px,-100%);
41+
transform: translate(-16px, -100%);
4442
margin-top: -4px;
4543
}
4644
@@ -114,9 +112,7 @@ describe('Avatar', () => {
114112
border-radius: 50%;
115113
object-fit: cover;
116114
position: absolute;
117-
-webkit-transform: translate(-16px,-100%);
118-
-ms-transform: translate(-16px,-100%);
119-
transform: translate(-16px,-100%);
115+
transform: translate(-16px, -100%);
120116
margin-top: -4px;
121117
}
122118

packages/strapi-design-system/src/Breadcrumbs/__tests__/Breadcrumbs.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('Breadcrumb', () => {
2020
const spanList = container.querySelectorAll('span');
2121

2222
expect(crumbList.length).toEqual(1);
23-
expect(spanList.length).toEqual(1);
23+
expect(spanList.length).toEqual(2);
2424
});
2525

2626
it('should render two crumbs with only one separator', async () => {
@@ -38,6 +38,6 @@ describe('Breadcrumb', () => {
3838
const spanList = container.querySelectorAll('span');
3939

4040
expect(crumbList.length).toEqual(2);
41-
expect(spanList.length).toEqual(3);
41+
expect(spanList.length).toEqual(4);
4242
});
4343
});

packages/strapi-design-system/src/LiveRegions/__tests__/LiveRegions.test.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ describe('LiveRegions', () => {
3737
expect(container).toMatchInlineSnapshot(`
3838
.c0 {
3939
border: 0;
40-
-webkit-clip: rect(0 0 0 0);
4140
clip: rect(0 0 0 0);
4241
height: 1px;
4342
margin: -1px;
@@ -48,7 +47,7 @@ describe('LiveRegions', () => {
4847
}
4948
5049
<div>
51-
<div
50+
<span
5251
class="c0"
5352
>
5453
<p
@@ -71,7 +70,7 @@ describe('LiveRegions', () => {
7170
id="live-region-alert"
7271
role="alert"
7372
/>
74-
</div>
73+
</span>
7574
</div>
7675
`);
7776
});
@@ -92,7 +91,6 @@ describe('LiveRegions', () => {
9291
expect(container).toMatchInlineSnapshot(`
9392
.c0 {
9493
border: 0;
95-
-webkit-clip: rect(0 0 0 0);
9694
clip: rect(0 0 0 0);
9795
height: 1px;
9896
margin: -1px;
@@ -103,7 +101,7 @@ describe('LiveRegions', () => {
103101
}
104102
105103
<div>
106-
<div
104+
<span
107105
class="c0"
108106
>
109107
<p
@@ -126,7 +124,7 @@ describe('LiveRegions', () => {
126124
id="live-region-alert"
127125
role="alert"
128126
/>
129-
</div>
127+
</span>
130128
</div>
131129
`);
132130
});
@@ -147,7 +145,6 @@ describe('LiveRegions', () => {
147145
expect(container).toMatchInlineSnapshot(`
148146
.c0 {
149147
border: 0;
150-
-webkit-clip: rect(0 0 0 0);
151148
clip: rect(0 0 0 0);
152149
height: 1px;
153150
margin: -1px;
@@ -158,7 +155,7 @@ describe('LiveRegions', () => {
158155
}
159156
160157
<div>
161-
<div
158+
<span
162159
class="c0"
163160
>
164161
<p
@@ -181,7 +178,7 @@ describe('LiveRegions', () => {
181178
>
182179
An alert message
183180
</p>
184-
</div>
181+
</span>
185182
</div>
186183
`);
187184
});

0 commit comments

Comments
 (0)