From 75f215d1357f4b1cbf13b487311d06bf571d8307 Mon Sep 17 00:00:00 2001 From: soyuka Date: Fri, 28 Jun 2024 15:35:29 +0200 Subject: [PATCH] attempt to add test --- api/config/bundles.php | 2 +- src/stories/Basic.stories.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/api/config/bundles.php b/api/config/bundles.php index 1e801054..94cce36e 100644 --- a/api/config/bundles.php +++ b/api/config/bundles.php @@ -7,7 +7,7 @@ Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], - Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], + // Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true], Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], diff --git a/src/stories/Basic.stories.ts b/src/stories/Basic.stories.ts index 3402a0b8..b6317852 100644 --- a/src/stories/Basic.stories.ts +++ b/src/stories/Basic.stories.ts @@ -1,5 +1,5 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { within } from '@storybook/test'; +import { userEvent, within } from '@storybook/test'; import Basic from './Basic'; const meta = { @@ -19,6 +19,11 @@ export const Admin: Story = { play: async ({ canvasElement }) => { const canvas = within(canvasElement); await canvas.findByRole('heading', { name: 'Greetings' }); + + await userEvent.click(canvas.getByText('Create')); + await userEvent.type(canvasElement.querySelector('#name'), 'test'); + await userEvent.click(canvasElement.querySelector('button[type=submit]')); + }, args: { entrypoint: process.env.ENTRYPOINT,