Update tests
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
This commit is contained in:
@@ -56,7 +56,6 @@
|
||||
"@storybook/react": "^8.6.8",
|
||||
"@storybook/react-webpack5": "^8.6.8",
|
||||
"@storybook/test": "^8.6.8",
|
||||
"@testing-library/jest-dom": "^6.0.0",
|
||||
"@types/react": "^18.0.0",
|
||||
"@types/react-dom": "^18.0.0",
|
||||
"chalk": "^5.4.1",
|
||||
|
||||
@@ -19,8 +19,8 @@ import type { Meta, StoryObj } from '@storybook/react';
|
||||
import { TextField } from './TextField';
|
||||
import { Form } from '@base-ui-components/react/form';
|
||||
import { Button } from '../Button';
|
||||
import { userEvent, waitFor, within, expect } from '@storybook/test';
|
||||
import { Flex } from '../Flex';
|
||||
import { waitFor, within, userEvent, expect } from '@storybook/test';
|
||||
|
||||
const meta = {
|
||||
title: 'Components/TextField',
|
||||
@@ -170,13 +170,13 @@ export const ShowErrorOnSubmit: Story = {
|
||||
});
|
||||
|
||||
const submitButton = canvas.getByRole('button');
|
||||
|
||||
await userEvent.click(submitButton);
|
||||
|
||||
await waitFor(() => {
|
||||
expect(
|
||||
canvas.getByText('The example domain is not allowed'),
|
||||
).toBeInTheDocument();
|
||||
const errorMessage = canvas.queryByText(
|
||||
'The example domain is not allowed',
|
||||
);
|
||||
expect(errorMessage).toBeTruthy();
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user