test: add sleep
This commit is contained in:
parent
cdedf94e1f
commit
e86b468d49
|
|
@ -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 も通しておく
|
||||
|
|
|
|||
Loading…
Reference in New Issue