fix: fix storybook pages tests coverage (#5319)
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { Meta, StoryObj } from '@storybook/react';
|
||||
import { userEvent, within } from '@storybook/test';
|
||||
|
||||
import {
|
||||
PageDecorator,
|
||||
@ -37,3 +38,38 @@ export const CustomObject: Story = {
|
||||
routeParams: { ':objectSlug': 'workspaces' },
|
||||
},
|
||||
};
|
||||
|
||||
export const ObjectDropdownMenu: Story = {
|
||||
play: async ({ canvasElement }) => {
|
||||
await sleep(100);
|
||||
|
||||
const canvas = within(canvasElement);
|
||||
const objectSummaryVerticalDotsIconButton = await canvas.findByRole(
|
||||
'button',
|
||||
{
|
||||
name: 'Object Options',
|
||||
},
|
||||
);
|
||||
|
||||
await userEvent.click(objectSummaryVerticalDotsIconButton);
|
||||
|
||||
await canvas.findByText('Edit');
|
||||
await canvas.findByText('Deactivate');
|
||||
},
|
||||
};
|
||||
|
||||
export const FieldDropdownMenu: Story = {
|
||||
play: async ({ canvasElement }) => {
|
||||
await sleep(100);
|
||||
|
||||
const canvas = within(canvasElement);
|
||||
const [fieldVerticalDotsIconButton] = await canvas.findAllByRole('button', {
|
||||
name: 'Active Field Options',
|
||||
});
|
||||
|
||||
await userEvent.click(fieldVerticalDotsIconButton);
|
||||
|
||||
await canvas.findByText('View');
|
||||
await canvas.findByText('Deactivate');
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user