Skip to content

Commit 74da6b5

Browse files
committed
fixup! fixup! fixup! Transform Layouts jest tests into playwright (#594)
1 parent 781b42f commit 74da6b5

16 files changed

+63
-0
lines changed

src/components/FormLayout/__tests__/FormLayout.spec.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ import {
1010
} from './FormLayout.story';
1111
import { labelWidthPropTest } from './_propTests/labelWidthPropTest';
1212
import { fieldLayoutPropTest } from './_propTests/fieldLayoutPropTest';
13+
import { autoWidthPropTest } from './_propTests/autoWidthPropTest';
1314

1415
test.describe('FormLayout', () => {
1516
test.describe('base', () => {
1617
test.describe('visual', () => {
1718
[
1819
...propTests.defaultComponentPropTest,
20+
...autoWidthPropTest,
1921
...labelWidthPropTest,
2022
...fieldLayoutPropTest,
2123
].forEach(({
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { PropTests } from '../../../../../tests/playwright/types';
2+
3+
export const autoWidthPropTest:PropTests = [
4+
{
5+
name: 'autoWidth:boolean=true',
6+
props: {
7+
autoWidth: true,
8+
},
9+
},
10+
{
11+
name: 'autoWidth:boolean=false',
12+
props: {
13+
autoWidth: false,
14+
},
15+
},
16+
];

src/components/FormLayout/__tests__/_propTests/customFieldTests/customFieldRequiredPropTest.ts

+9
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,13 @@ export const customFieldRequiredPropTest: CustomFieldTestsType = [
2424
name: 'required:boolean=true',
2525
props: formLayoutHorizontalBaseProps,
2626
},
27+
{
28+
customFieldLayoutProps: {
29+
...customFieldLayoutBaseProps,
30+
required: false,
31+
},
32+
customFieldProps: customFieldBaseProps,
33+
name: 'required:boolean=false',
34+
props: formLayoutHorizontalBaseProps,
35+
},
2736
];

src/components/FormLayout/__tests__/_propTests/fieldLayoutPropTest.ts

+6
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@ export const fieldLayoutPropTest: PropTests = [
77
fieldLayout: 'horizontal',
88
},
99
},
10+
{
11+
name: 'fieldLayout:string=vertical',
12+
props: {
13+
fieldLayout: 'vertical',
14+
},
15+
},
1016
];

src/components/Toolbar/__tests__/_propTets/alignPropTest.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import type { PropTests } from '../../../../../tests/playwright/types';
22

33
export const alignPropTest: PropTests = [
4+
{
5+
name: 'align:string=top',
6+
props: {
7+
align: 'top',
8+
},
9+
},
410
{
511
name: 'align:string=middle',
612
props: {

src/components/Toolbar/__tests__/_propTets/densePropTest.ts

+6
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@ export const densePropTest: PropTests = [
77
dense: true,
88
},
99
},
10+
{
11+
name: 'dense:boolean=false',
12+
props: {
13+
dense: false,
14+
},
15+
},
1016
];

src/components/Toolbar/__tests__/_propTets/justifyPropTest.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import type { PropTests } from '../../../../../tests/playwright/types';
22

33
export const justifyPropTest: PropTests = [
4+
{
5+
name: 'justify:string=start',
6+
props: {
7+
justify: 'start',
8+
},
9+
},
410
{
511
name: 'justify:string=center',
612
props: {

src/components/Toolbar/__tests__/_propTets/nowrapProptest.ts

+12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
import type { PropTests } from '../../../../../tests/playwright/types';
22

33
export const nowrapPropTest: PropTests = [
4+
{
5+
name: 'nowrap:boolean=false',
6+
onBeforeTest: async (page) => {
7+
await page.setViewportSize({
8+
height: 100,
9+
width: 150,
10+
});
11+
},
12+
props: {
13+
nowrap: false,
14+
},
15+
},
416
{
517
name: 'nowrap:boolean=true',
618
onBeforeTest: async (page) => {

0 commit comments

Comments
 (0)