Skip to content

Commit 854e3de

Browse files
committed
Update debounce time in tests to 1000ms and enhance error message validation
1 parent 8e517dd commit 854e3de

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/useAjvForm.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,13 @@ describe('useAJVForm', () => {
247247
result.current.set({ title: 'Hi' });
248248

249249
act(() => {
250-
vi.advanceTimersByTime(500);
250+
vi.advanceTimersByTime(1000);
251251
});
252252

253253
expect(result.current.state.title.error).not.toBe('');
254+
expect(result.current.state.title.error).toBe(
255+
'Should be at least 3 characters long.',
256+
);
254257
});
255258

256259
it('should not validate and debounce if shouldDebounceAndValidate is set to false', async () => {

0 commit comments

Comments
 (0)