Skip to content

Commit 8dae85c

Browse files
committed
feat(TextInputMapper): add component * 2
1 parent a61e6db commit 8dae85c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/components/fields/TextInputMapper/TextInputMapper.stories.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { StoryFn } from '@storybook/react';
2+
import { userEvent, within } from '@storybook/test';
23

34
import { baseProps } from '../../../stories/lists/baseProps';
45
import { Submit } from '../../actions';
@@ -49,5 +50,15 @@ Default.args = {};
4950
export const WithValue = Template.bind({});
5051
WithValue.args = { value: { name: 'value' } };
5152

53+
export const WithValueAndNewMapping = Template.bind({});
54+
WithValueAndNewMapping.args = { value: { name: 'value' } };
55+
56+
WithValueAndNewMapping.play = async ({ canvasElement }) => {
57+
const canvas = within(canvasElement);
58+
const button = await canvas.getByText('Mapping');
59+
60+
await userEvent.click(button);
61+
};
62+
5263
export const WithinForm = FormTemplate.bind({});
5364
WithinForm.args = {};

src/components/fields/TextInputMapper/TextInputMapper.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ function TextInputMapperInput(props: CubeTextInputMapperInputProps) {
242242

243243
return (
244244
<TextInput
245+
qa="AddMapping"
245246
width="auto"
246247
{...rest}
247248
id={undefined}

0 commit comments

Comments
 (0)