test(tags): replace 1 setTimeout sleep in TagTreeNode with vi.waitFor

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-11 17:44:00 +02:00
committed by marcel
parent 6da686ccea
commit d754e23922

View File

@@ -164,8 +164,7 @@ describe('TagTreeNode', () => {
/einklappen|ausklappen/i.test(b.getAttribute('aria-label') ?? '')
) as HTMLButtonElement;
toggle?.click();
await new Promise((r) => setTimeout(r, 30));
// Map should have been mutated to opposite of current isCollapsed (false → true)
expect(map.get('tp1')).toBe(true);
// Map should have been mutated to opposite of current isCollapsed (false → true).
await vi.waitFor(() => expect(map.get('tp1')).toBe(true));
});
});