test(briefwechsel): replace 1 setTimeout sleep in CorrespondenzPersonBar with vi.waitFor
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -110,10 +110,8 @@ describe('CorrespondenzPersonBar', () => {
|
||||
const corrInput = inputs[inputs.length - 1] as HTMLInputElement;
|
||||
corrInput.dispatchEvent(new Event('focus', { bubbles: true }));
|
||||
|
||||
await new Promise((r) => setTimeout(r, 100));
|
||||
// No assertion on the suggestions dropdown UI (component-internal),
|
||||
// just confirm the fetch was made
|
||||
expect(fetchSpy).toHaveBeenCalled();
|
||||
// Confirm the typeahead fired the suggestions fetch.
|
||||
await vi.waitFor(() => expect(fetchSpy).toHaveBeenCalled());
|
||||
} finally {
|
||||
fetchSpy.mockRestore();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user