test: support e2e in storybook (#1533)

This commit is contained in:
Himself65
2023-03-24 22:25:27 -05:00
committed by GitHub
parent 6d13716e97
commit d8e48ef6aa
10 changed files with 1103 additions and 378 deletions

View File

@@ -1,5 +1,6 @@
/* deepscan-disable USELESS_ARROW_FUNC_BIND */
import type { Meta, StoryFn } from '@storybook/react';
import { useState } from 'react';
import { Button } from '..';
import type { ButtonProps } from '../ui/button/interface';
@@ -44,3 +45,27 @@ Danger.args = {
type: 'danger',
children: 'This is a danger button',
};
export const Test: StoryFn<ButtonProps> = () => {
const [input, setInput] = useState('');
return (
<>
<input
type="text"
data-testid="test-input"
value={input}
onChange={e => setInput(e.target.value)}
/>
<Button
onClick={() => {
setInput('');
}}
data-testid="clear-button"
>
clear
</Button>
</>
);
};
Test.storyName = 'Click Test';