2023-04-06 03:10:45 +09:00
|
|
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
2023-04-13 12:20:39 +09:00
|
|
|
import { action } from '@storybook/addon-actions';
|
2023-04-06 03:10:45 +09:00
|
|
|
import { expect } from '@storybook/jest';
|
|
|
|
import { waitFor } from '@storybook/testing-library';
|
|
|
|
import { StoryObj } from '@storybook/vue3';
|
|
|
|
import MkError from './MkError.vue';
|
|
|
|
export const Default = {
|
|
|
|
render(args) {
|
|
|
|
return {
|
|
|
|
components: {
|
|
|
|
MkError,
|
|
|
|
},
|
|
|
|
setup() {
|
|
|
|
return {
|
|
|
|
args,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
props() {
|
|
|
|
return {
|
|
|
|
...this.args,
|
|
|
|
};
|
|
|
|
},
|
2023-04-13 12:20:39 +09:00
|
|
|
events() {
|
|
|
|
return {
|
|
|
|
retry: action('retry'),
|
|
|
|
};
|
|
|
|
},
|
2023-04-06 03:10:45 +09:00
|
|
|
},
|
2023-04-13 12:20:39 +09:00
|
|
|
template: '<MkError v-bind="props" v-on="events" />',
|
2023-04-06 03:10:45 +09:00
|
|
|
};
|
|
|
|
},
|
|
|
|
async play({ canvasElement }) {
|
|
|
|
await expect(canvasElement.firstElementChild).not.toBeNull();
|
|
|
|
await waitFor(async () => expect(canvasElement.firstElementChild?.classList).not.toContain('_transition_zoom-enter-active'));
|
|
|
|
},
|
2023-04-13 12:20:39 +09:00
|
|
|
args: {
|
|
|
|
},
|
2023-04-06 03:10:45 +09:00
|
|
|
parameters: {
|
|
|
|
layout: 'centered',
|
|
|
|
},
|
|
|
|
} satisfies StoryObj<typeof MkError>;
|