Skip to content

Commit

Permalink
refactor: update tests that depent on getErrors()
Browse files Browse the repository at this point in the history
  • Loading branch information
genu committed Feb 6, 2025
1 parent 139335a commit a8c106e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
6 changes: 2 additions & 4 deletions packages/ecosystem/src/valibot/valibot.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ test('collects multiple errors per field', async () => {
await fireEvent.click(screen.getByText('Submit'));
await flush();
expect(handler).toHaveBeenCalledWith([
{
path: 'test',
messages: ['Invalid email: Received "123"', 'Invalid length: Expected >=8 but received 3'],
},
'Invalid email: Received "123"',
'Invalid length: Expected >=8 but received 3',
]);
});
7 changes: 1 addition & 6 deletions packages/ecosystem/src/zod/zod.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,5 @@ test('collects multiple errors per field', async () => {

await fireEvent.click(screen.getByText('Submit'));
await flush();
expect(handler).toHaveBeenCalledWith([
{
path: 'test',
messages: ['Invalid email', 'String must contain at least 8 character(s)'],
},
]);
expect(handler).toHaveBeenCalledWith(['Invalid email', 'String must contain at least 8 character(s)']);
});

0 comments on commit a8c106e

Please sign in to comment.