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;
|
const corrInput = inputs[inputs.length - 1] as HTMLInputElement;
|
||||||
corrInput.dispatchEvent(new Event('focus', { bubbles: true }));
|
corrInput.dispatchEvent(new Event('focus', { bubbles: true }));
|
||||||
|
|
||||||
await new Promise((r) => setTimeout(r, 100));
|
// Confirm the typeahead fired the suggestions fetch.
|
||||||
// No assertion on the suggestions dropdown UI (component-internal),
|
await vi.waitFor(() => expect(fetchSpy).toHaveBeenCalled());
|
||||||
// just confirm the fetch was made
|
|
||||||
expect(fetchSpy).toHaveBeenCalled();
|
|
||||||
} finally {
|
} finally {
|
||||||
fetchSpy.mockRestore();
|
fetchSpy.mockRestore();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user