Skip to content

Commit

Permalink
pkp/pkp-lib#10033 Add click user event when rendering stories for Dro…
Browse files Browse the repository at this point in the history
…pdownActions component
  • Loading branch information
blesildaramirez committed Jun 17, 2024
1 parent 37b48c7 commit 6b070fd
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions src/components/DropdownActions/DropdownActions.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import DropdownActions from './DropdownActions.vue';
import {within, userEvent} from '@storybook/test';

export default {
title: 'Components/DropdownActions',
Expand Down Expand Up @@ -60,9 +61,16 @@ export const Default = {
},
decorators: [
() => ({
template: '<div style="height: 200px"><story/></div>',
template: '<div style="height: 250px"><story/></div>',
}),
],
play: async ({canvasElement}) => {
// Assigns canvas to the component root element
const canvas = within(canvasElement);
const user = userEvent.setup();

await user.click(canvas.getByRole('button'));
},
};

export const EllipsisMenu = {
Expand Down Expand Up @@ -105,9 +113,16 @@ export const EllipsisMenu = {
},
decorators: [
() => ({
template: '<div style="height: 270px"><story/></div>',
template: '<div style="height: 300px"><story/></div>',
}),
],
play: async ({canvasElement}) => {
// Assigns canvas to the component root element
const canvas = within(canvasElement);
const user = userEvent.setup();

await user.click(canvas.getByRole('button'));
},
};

export const LeftPosition = {
Expand All @@ -118,7 +133,14 @@ export const LeftPosition = {
},
decorators: [
() => ({
template: '<div style="height: 200px"><story/></div>',
template: '<div style="height: 250px"><story/></div>',
}),
],
play: async ({canvasElement}) => {
// Assigns canvas to the component root element
const canvas = within(canvasElement);
const user = userEvent.setup();

await user.click(canvas.getByRole('button'));
},
};

0 comments on commit 6b070fd

Please sign in to comment.