Skip to content

Commit

Permalink
pkp/pkp-lib#9527 Also automatically open dialogs for snapshotting
Browse files Browse the repository at this point in the history
  • Loading branch information
jardakotesovec committed Jan 11, 2024
1 parent 41cc620 commit 0735438
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/composables/useDialog.stories.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import {within, userEvent} from '@storybook/testing-library';

import {useDialog} from './useDialog';
import PkpButton from '@/components/Button/Button.vue';

Expand Down Expand Up @@ -38,6 +40,18 @@ export const BasicExample = {
},
],
},
play: async ({canvasElement}) => {
// Assigns canvas to the component root element
const canvas = within(canvasElement);
const user = userEvent.setup();

await user.click(canvas.getByText('Basic Example'));
},
decorators: [
() => ({
template: '<div style="height: 400px"><story/></div>',
}),
],
};

export const FullExample = {
Expand Down Expand Up @@ -70,4 +84,16 @@ export const FullExample = {
],
close: () => console.log('closed full example dialog'), // eslint-disable-line
},
play: async ({canvasElement}) => {
// Assigns canvas to the component root element
const canvas = within(canvasElement);
const user = userEvent.setup();

await user.click(canvas.getByText('Full Example'));
},
decorators: [
() => ({
template: '<div style="height: 400px"><story/></div>',
}),
],
};

0 comments on commit 0735438

Please sign in to comment.