Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

test: await route focus frame before search assertion

Amruth Pillaibd0ce4892959
diff --git a/apps/web/src/components/layout/navigation-focus.test.tsx b/apps/web/src/components/layout/navigation-focus.test.tsx
index e7470008a..7ae7c7352 100644
--- a/apps/web/src/components/layout/navigation-focus.test.tsx
+++ b/apps/web/src/components/layout/navigation-focus.test.tsx
@@ -106,6 +106,9 @@ it.each([false, true])(
const field = screen.getByRole("textbox", { name: "Search" });
field.focus();
await router.navigate({ to: "/two", search: { q: "retained" } });
+ await act(
+ () => new Promise<void>((resolve) => requestAnimationFrame(() => requestAnimationFrame(() => resolve()))),
+ );
expect(field).toHaveFocus();
},
);