fix(web): resolve flaky CI test failures in LinkAutocomplete and FilterBar
All checks were successful
ci/woodpecker/push/web Pipeline was successful

- LinkAutocomplete: use refs for event handler state to prevent stale
  closures when effect re-attachment is delayed in slower CI environments
- FilterBar: increase debounce test timeout from 100ms to 500ms to
  prevent premature timer firing during userEvent.type in CI

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-21 15:08:47 -06:00
parent bc4c1f9c70
commit 064b06fff4

View File

@@ -46,8 +46,8 @@ describe("FilterBar", (): void => {
it("should debounce search input", async (): Promise<void> => {
const user = userEvent.setup();
// Use a very short debounce to test the behavior without flaky timing
render(<FilterBar onFilterChange={mockOnFilterChange} debounceMs={100} />);
// Use a debounce long enough that CI environments don't fire it between keystrokes
render(<FilterBar onFilterChange={mockOnFilterChange} debounceMs={500} />);
const searchInput = screen.getByPlaceholderText(/search/i);
mockOnFilterChange.mockClear();
@@ -71,7 +71,7 @@ describe("FilterBar", (): void => {
expect.objectContaining({ search: "test" })
);
},
{ timeout: 200 }
{ timeout: 1000 }
);
// Verify it was only called once (debounced)