From 4ac2fb2446d9928696a035732f7e094d284a4838 Mon Sep 17 00:00:00 2001 From: thesiti92 Date: Thu, 8 Oct 2026 09:17:39 -0400 Subject: [PATCH] Wait a frame for Find's active highlight in its browser test --- .../src/review-find-controller.browser.test.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/review/app/src/review-find-controller.browser.test.tsx b/packages/review/app/src/review-find-controller.browser.test.tsx index fa04a386e..8a62aa5bf 100644 --- a/packages/review/app/src/review-find-controller.browser.test.tsx +++ b/packages/review/app/src/review-find-controller.browser.test.tsx @@ -76,12 +76,15 @@ it("orders duplicate editors with MDX and wraps navigation", async () => { "::highlight(review-find-match)", ).backgroundColor, ).toBe("rgb(10, 20, 30)"); - expect( - getComputedStyle( - container.querySelector("article")!, - "::highlight(review-find-match-active)", - ).backgroundColor, - ).toBe("rgb(40, 50, 60)"); + // The active match is highlighted on the next frame. + await vi.waitFor(() => { + expect( + getComputedStyle( + container.querySelector("article")!, + "::highlight(review-find-match-active)", + ).backgroundColor, + ).toBe("rgb(40, 50, 60)"); + }); // The shell is the widget's containing block. expect( container.querySelector(".review-find-widget")?.parentElement,