Skip to content

Commit faa0a7e

Browse files
committed
test: add tests for Column view
1 parent f605d83 commit faa0a7e

File tree

6 files changed

+69
-0
lines changed

6 files changed

+69
-0
lines changed
Loading
18.6 KB
Loading
Loading
Loading
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react';
2+
3+
import {COLUMN_CARD} from './helpers';
4+
5+
import {test} from '~playwright/core';
6+
import {DynamicForm} from '~playwright/core/DynamicForm';
7+
8+
test.describe('Column Form', () => {
9+
test('object spec', async ({mount, expectScreenshot}) => {
10+
await mount(<DynamicForm spec={COLUMN_CARD} />);
11+
12+
await expectScreenshot();
13+
});
14+
});
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import {FormValue, ObjectSpec, SpecTypes} from '../../../../../core';
2+
3+
export const COLUMN_CARD: ObjectSpec = {
4+
defaultValue: {
5+
name: 'value',
6+
age: 10,
7+
license: false,
8+
},
9+
type: SpecTypes.Object,
10+
properties: {
11+
name: {
12+
type: SpecTypes.String,
13+
viewSpec: {
14+
type: 'base',
15+
layout: 'column',
16+
layoutDescription: 'Description for Name',
17+
layoutTitle: 'Name',
18+
},
19+
},
20+
age: {
21+
type: SpecTypes.Number,
22+
viewSpec: {
23+
type: 'base',
24+
layout: 'column',
25+
layoutDescription: 'Description for Age',
26+
layoutTitle: 'Age',
27+
},
28+
},
29+
license: {
30+
type: SpecTypes.Boolean,
31+
viewSpec: {
32+
type: 'base',
33+
layout: 'column',
34+
layoutDescription: 'Description for License',
35+
layoutTitle: 'License',
36+
},
37+
},
38+
},
39+
viewSpec: {
40+
type: 'base',
41+
layout: 'accordeon',
42+
layoutTitle: 'Candidate',
43+
layoutDescription: 'Description for base',
44+
layoutOpen: true,
45+
},
46+
};
47+
48+
export const VALUE: Record<string, FormValue> = {
49+
array: ['value', 'value'],
50+
object: {
51+
name: 'name',
52+
age: 21,
53+
license: true,
54+
},
55+
};

0 commit comments

Comments
 (0)