2023-07-27 07:31:52 +02:00
|
|
|
/*
|
2024-02-13 16:50:11 +01:00
|
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
2023-07-27 07:31:52 +02:00
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2023-04-05 20:10:45 +02:00
|
|
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
2023-04-13 05:20:39 +02:00
|
|
|
import { action } from '@storybook/addon-actions';
|
2023-04-05 20:10:45 +02: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 05:20:39 +02:00
|
|
|
events() {
|
|
|
|
return {
|
|
|
|
retry: action('retry'),
|
|
|
|
};
|
|
|
|
},
|
2023-04-05 20:10:45 +02:00
|
|
|
},
|
2023-04-13 05:20:39 +02:00
|
|
|
template: '<MkError v-bind="props" v-on="events" />',
|
2023-04-05 20:10:45 +02: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 05:20:39 +02:00
|
|
|
args: {
|
|
|
|
},
|
2023-04-05 20:10:45 +02:00
|
|
|
parameters: {
|
|
|
|
layout: 'centered',
|
|
|
|
},
|
|
|
|
} satisfies StoryObj<typeof MkError>;
|