Fix Storybook stories (Datamodel edition / preview / signOut) (#5019)

As per title ; some small changes on broken stories
This commit is contained in:
Charles Bochet
2024-04-17 18:48:41 +02:00
committed by GitHub
parent 627a6bda29
commit a52f2e5bd9
7 changed files with 65 additions and 52 deletions

View File

@ -1,5 +1,5 @@
import { Meta, StoryObj } from '@storybook/react';
import { within } from '@storybook/test';
import { userEvent, within } from '@storybook/test';
import {
PageDecorator,
@ -13,7 +13,10 @@ const meta: Meta<PageDecoratorArgs> = {
title: 'Pages/Settings/SettingsProfile',
component: SettingsProfile,
decorators: [PageDecorator],
args: { routePath: '/settings/profile' },
args: {
routePath: '/settings/profile',
additionalRoutes: ['/welcome'],
},
parameters: {
msw: graphqlMocks,
},
@ -29,6 +32,7 @@ export const LogOut: Story = {
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
const logoutButton = await canvas.findByText('Logout');
await logoutButton.click();
await userEvent.click(logoutButton);
},
};