Skip to content

Commit

Permalink
test: use flush before submit
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Aug 13, 2024
1 parent a0ec46d commit 0fe6ae2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/schema-yup/src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Component, nextTick } from 'vue';
import { type Component } from 'vue';
import { fireEvent, render, screen } from '@testing-library/vue';
import { useForm, useTextField } from '@formwerk/core';
import { defineSchema } from '.';
Expand Down Expand Up @@ -129,8 +129,8 @@ describe('schema-yup', () => {
`,
});

await nextTick();
await fireEvent.click(screen.getByText('Submit'));
await flush();
expect(handler).not.toHaveBeenCalled();
await fireEvent.update(screen.getByTestId('test'), 'test');
await fireEvent.click(screen.getByText('Submit'));
Expand Down
4 changes: 2 additions & 2 deletions packages/schema-zod/src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type Component, nextTick } from 'vue';
import { type Component } from 'vue';
import { fireEvent, render, screen } from '@testing-library/vue';
import { useForm, useTextField } from '@formwerk/core';
import { defineSchema } from '.';
Expand Down Expand Up @@ -77,8 +77,8 @@ describe('schema-zod', () => {
`,
});

await nextTick();
await fireEvent.click(screen.getByText('Submit'));
await flush();
expect(handler).not.toHaveBeenCalled();
await fireEvent.update(screen.getByTestId('test'), 'test');
await fireEvent.click(screen.getByText('Submit'));
Expand Down

0 comments on commit 0fe6ae2

Please sign in to comment.