Skip to content

Commit 90b2afb

Browse files
committed
fixup! fixup! fixup! fixup! fixup! fixup! Transform Action jest tests into playwright (#592)
1 parent 29c3f83 commit 90b2afb

File tree

11 files changed

+71
-51
lines changed

11 files changed

+71
-51
lines changed

src/components/Button/__tests__/Button.spec.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ test.describe('Button', () => {
1919
...propTests.afterLabelPropTest,
2020
...propTests.beforeLabelPropTest,
2121
...propTests.blockPropTest,
22+
...propTests.endCornerPropTest,
23+
...propTests.feedbackIconPropTest,
24+
...propTests.labelPropTest,
25+
...propTests.labelVisibilityPropTest,
26+
...propTests.sizePropTest,
27+
...propTests.startCornerPropTest,
2228
...mixPropTests([
2329
[
2430
...propTests.actionColorPropTest,
@@ -28,12 +34,6 @@ test.describe('Button', () => {
2834
propTests.disabledPropTest,
2935
propTests.priorityPropTest,
3036
]),
31-
...propTests.endCornerPropTest,
32-
...propTests.feedbackIconPropTest,
33-
...propTests.labelPropTest,
34-
...propTests.labelVisibilityPropTest,
35-
...propTests.sizePropTest,
36-
...propTests.startCornerPropTest,
3737
].forEach(({
3838
name,
3939
onBeforeTest,

src/components/CheckboxField/__tests__/CheckboxField.spec.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,25 @@ test.describe('CheckboxField', () => {
1919
test.describe('visual', () => {
2020
[
2121
...propTests.defaultComponentPropTest,
22-
...propTests.labelPropTest,
23-
...propTests.renderAsRequiredPropTest,
22+
...propTests.helpTextAndValidationTextPropType,
2423
...propTests.isLabelVisiblePropTest,
2524
...propTests.labelPositionPropTest,
26-
...propTests.helperTextAndValidationTextPropType,
25+
...propTests.labelPropTest,
26+
...propTests.renderAsRequiredPropTest,
2727
...mixPropTests([
28-
propTests.checkedPropTest,
2928
propTests.disabledPropTest,
29+
propTests.checkedPropTest,
3030
propTests.validationStatePropTest,
3131
]),
3232
...mixPropTests([
3333
propTests.checkedPropTest,
34-
propTests.validationStatePropTest,
3534
propTests.requiredPropTest,
35+
propTests.validationStatePropTest,
3636
]),
3737
...mixPropTests([
3838
propTests.checkedPropTest,
39-
propTests.validationStatePropTest,
4039
propTests.renderAsRequiredPropTest,
40+
propTests.validationStatePropTest,
4141
]),
4242
...mixPropTests([
4343
propTests.checkedPropTest,

src/components/Radio/__tests__/Radio.spec.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,24 @@ test.describe('Radio', () => {
3939
test.describe('visual', () => {
4040
[
4141
...propTests.defaultComponentPropTest,
42-
...propTests.requiredPropTest,
43-
...propTests.labelPropTest,
42+
...propTests.helpTextAndValidationTextPropType,
4443
...propTests.isLabelVisiblePropTest,
45-
...propTests.renderAsRequiredPropTest,
44+
...propTests.labelPropTest,
4645
...propTests.layoutPropTest,
47-
...propTests.helperTextAndValidationTextPropType,
46+
...propTests.renderAsRequiredPropTest,
47+
...propTests.requiredPropTest,
4848
...mixPropTests([
49+
propTests.disabledPropTest,
4950
propTests.validationStatePropTest,
5051
propTests.validationTextPropTest,
51-
propTests.disabledPropTest,
5252
]),
5353
...mixPropTests([
54-
propTests.validationStatePropTest,
5554
propTests.requiredPropTest,
55+
propTests.validationStatePropTest,
5656
]),
5757
...mixPropTests([
58-
propTests.validationStatePropTest,
5958
propTests.renderAsRequiredPropTest,
59+
propTests.validationStatePropTest,
6060
]),
6161
...mixPropTests([
6262
partialDisabledOptionsPropTest,

src/components/SelectField/__tests__/SelectField.spec.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -53,28 +53,28 @@ test.describe('SelectField', () => {
5353
test.describe('visual', () => {
5454
[
5555
...propTests.defaultComponentPropTest,
56+
...propTests.helpTextAndValidationTextPropType,
57+
...propTests.isLabelVisiblePropTest,
5658
...propTests.labelPropTest,
5759
...propTests.renderAsRequiredPropTest,
58-
...propTests.isLabelVisiblePropTest,
5960
...propTests.requiredPropTest,
60-
...propTests.helperTextAndValidationTextPropType,
6161
...propTests.sizePropTest,
6262
...mixPropTests([
63-
propTests.layoutPropTest,
6463
propTests.fullWidthPropTest,
64+
propTests.layoutPropTest,
6565
]),
6666
...mixPropTests([
67-
propTests.validationStatePropTest,
6867
propTests.requiredPropTest,
68+
propTests.validationStatePropTest,
6969
]),
7070
...mixPropTests([
71-
propTests.validationStatePropTest,
7271
propTests.renderAsRequiredPropTest,
72+
propTests.validationStatePropTest,
7373
]),
7474
...mixPropTests([
7575
propTests.disabledPropTest,
76-
propTests.variantPropTest,
7776
propTests.validationStatePropTest,
77+
propTests.variantPropTest,
7878
]),
7979
].forEach(({
8080
name,

src/components/TextArea/__tests__/TextArea.spec.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ test.describe('TextArea', () => {
1919
test.describe('visual', () => {
2020
[
2121
...propTests.defaultComponentPropTest,
22-
...propTests.labelPropTest,
22+
...propTests.helpTextAndValidationTextPropType,
2323
...propTests.isLabelVisiblePropTest,
24-
...propTests.sizePropTest,
24+
...propTests.labelPropTest,
2525
...propTests.requiredPropTest,
26-
...propTests.helperTextAndValidationTextPropType,
26+
...propTests.sizePropTest,
2727
...mixPropTests([
28-
propTests.layoutPropTest,
2928
propTests.fullWidthPropTest,
29+
propTests.layoutPropTest,
3030
]),
3131
...mixPropTests([
32-
propTests.validationStatePropTest,
3332
propTests.requiredPropTest,
33+
propTests.validationStatePropTest,
3434
]),
3535
...mixPropTests([
3636
propTests.disabledPropTest,
37-
propTests.variantPropTest,
3837
propTests.validationStatePropTest,
38+
propTests.variantPropTest,
3939
]),
4040
].forEach(({
4141
name,

src/components/TextField/__tests__/TextField.spec.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,25 @@ test.describe('TextField', () => {
2525
...propTests.isLabelVisiblePropTest,
2626
...propTests.sizePropTest,
2727
...propTests.requiredPropTest,
28-
...propTests.helperTextAndValidationTextPropType,
28+
...propTests.helpTextAndValidationTextPropType,
2929
...inputSizePropTest,
3030
...typePropTest,
3131
...mixPropTests([
32-
propTests.layoutPropTest,
3332
propTests.fullWidthPropTest,
33+
propTests.layoutPropTest,
3434
]),
3535
...mixPropTests([
36-
propTests.validationStatePropTest,
3736
propTests.requiredPropTest,
37+
propTests.validationStatePropTest,
3838
]),
3939
...mixPropTests([
40-
propTests.validationStatePropTest,
4140
propTests.renderAsRequiredPropTest,
41+
propTests.validationStatePropTest,
4242
]),
4343
...mixPropTests([
4444
propTests.disabledPropTest,
45-
propTests.variantPropTest,
4645
propTests.validationStatePropTest,
46+
propTests.variantPropTest,
4747
]),
4848
].forEach(({
4949
name,

src/components/Toggle/__tests__/Toggle.spec.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ test.describe('Toggle', () => {
1919
test.describe('visual', () => {
2020
[
2121
...propTests.defaultComponentPropTest,
22-
...propTests.labelPropTest,
22+
...propTests.helpTextAndValidationTextPropType,
2323
...propTests.isLabelVisiblePropTest,
2424
...propTests.labelPositionPropTest,
25+
...propTests.labelPropTest,
2526
...propTests.renderAsRequiredPropTest,
2627
...propTests.requiredPropTest,
27-
...propTests.helperTextAndValidationTextPropType,
2828
...mixPropTests([
2929
propTests.checkedPropTest,
30-
propTests.validationStatePropTest,
3130
propTests.requiredPropTest,
31+
propTests.validationStatePropTest,
3232
]),
3333
...mixPropTests([
3434
propTests.checkedPropTest,
35-
propTests.validationStatePropTest,
3635
propTests.renderAsRequiredPropTest,
36+
propTests.validationStatePropTest,
3737
]),
3838
...mixPropTests([
3939
propTests.disabledPropTest,

tests/playwright/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { feedbackColorPropTest } from './propTests/feedbackColorPropTest';
1010
import { feedbackIconPropTest } from './propTests/feedbackIconPropTest';
1111
import { fullWidthPropTest } from './propTests/fullWidthPropTest';
1212
import { helpTextPropTest } from './propTests/helpTextPropTest';
13-
import { helperTextAndValidationTextPropType } from './propTests/helperTextAndValidationTextPropType';
13+
import { helpTextAndValidationTextPropType } from './propTests/helpTextAndValidationTextPropType';
1414
import { iconPropTest } from './propTests/iconPropTest';
1515
import { isLabelVisiblePropTest } from './propTests/isLabelVisiblePropTest';
1616
import { labelPositionPropTest } from './propTests/labelPositionPropTest';
@@ -43,8 +43,8 @@ export const propTests = {
4343
feedbackColorPropTest,
4444
feedbackIconPropTest,
4545
fullWidthPropTest,
46+
helpTextAndValidationTextPropType,
4647
helpTextPropTest,
47-
helperTextAndValidationTextPropType,
4848
iconPropTest,
4949
isLabelVisiblePropTest,
5050
labelPositionPropTest,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import type { PropTests } from '../types';
2+
3+
export const helpTextAndValidationTextPropType: PropTests = [
4+
{
5+
name: 'helpText:string & validationText:undefined',
6+
props: {
7+
helpText: 'Some normal helpText.',
8+
validationText: undefined,
9+
},
10+
},
11+
{
12+
name: 'helpText:undefined & validationText:string',
13+
props: {
14+
helpText: undefined,
15+
validationText: 'Some normal validationText.',
16+
},
17+
},
18+
{
19+
name: 'helpText:string & validationText:string',
20+
props: {
21+
helpText: 'Some normal helpText.',
22+
validationText: 'Some normal validationText.',
23+
},
24+
},
25+
];

tests/playwright/propTests/helperTextAndValidationTextPropType.ts

-9
This file was deleted.

tests/playwright/propTests/validationStatePropTest.ts

+4
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@ export const validationStatePropTest: PropTests = [
1313
name: 'validationState:string=invalid',
1414
props: { validationState: 'invalid' },
1515
},
16+
{
17+
name: 'validationState:undefined',
18+
props: { validationState: undefined },
19+
},
1620
];

0 commit comments

Comments
 (0)