Skip to content

Commit 4597f09

Browse files
author
Vladimir Kubantsev
committed
chore(ArrayBase): add remove button test
1 parent 5005215 commit 4597f09

File tree

6 files changed

+30
-0
lines changed

6 files changed

+30
-0
lines changed
Loading
Loading
Loading
Loading

src/lib/kit/components/Inputs/ArrayBase/__tests__/ArrayBase.visual.test.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ test.describe('Array Base', () => {
4040
await expectScreenshot();
4141
});
4242

43+
test('error remove button', async ({mount, expectScreenshot}) => {
44+
const component = await mount(<DynamicForm spec={ARRAY_BASE.errorRemoveButton} />);
45+
const input = component.getByRole('textbox').first();
46+
47+
await input.focus();
48+
await input.blur();
49+
50+
await expectScreenshot();
51+
});
52+
4353
test('description', async ({mount, expectScreenshot}) => {
4454
await mount(<DynamicForm spec={ARRAY_BASE.description} />);
4555

src/lib/kit/components/Inputs/ArrayBase/__tests__/helpers.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,26 @@ export const ARRAY_BASE: Record<string, ArraySpec> = {
102102
itemLabel: 'Add element',
103103
},
104104
},
105+
errorRemoveButton: {
106+
type: SpecTypes.Array,
107+
defaultValue: ['foo'],
108+
items: {
109+
type: SpecTypes.String,
110+
pattern: 'bar',
111+
viewSpec: {
112+
type: 'base',
113+
layout: 'row',
114+
layoutTitle: 'Element',
115+
},
116+
},
117+
viewSpec: {
118+
type: 'base',
119+
layout: 'accordeon',
120+
layoutTitle: 'Elements',
121+
layoutOpen: true,
122+
itemLabel: 'Add element',
123+
},
124+
},
105125
description: {
106126
defaultValue: ['foo', 'bar', 'rab', 'oof'],
107127
type: SpecTypes.Array,

0 commit comments

Comments
 (0)