test: add sleep

This commit is contained in:
zyoshoka 2024-05-18 21:50:42 +09:00
parent cdedf94e1f
commit e86b468d49
No known key found for this signature in database
GPG Key ID: 0C2CB8FBA309A5B8
1 changed files with 6 additions and 0 deletions

View File

@ -11,6 +11,11 @@ import { action } from '@storybook/addon-actions';
import { expect, userEvent, within } from '@storybook/test';
import { commonHandlers } from '../../.storybook/mocks.js';
import MkClickerGame from './MkClickerGame.vue';
function sleep(ms: number) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export const Default = {
render(args) {
return {
@ -33,6 +38,7 @@ export const Default = {
};
},
async play({ canvasElement }) {
await sleep(1000);
const canvas = within(canvasElement);
const count = canvas.getByTestId('count');
// NOTE: flaky なので N/A も通しておく