From f3184b7b316a2431f54591470aff2ca36ceb7bbe Mon Sep 17 00:00:00 2001 From: Vito Sansevero Date: Wed, 21 Oct 2026 12:11:36 -0700 Subject: [PATCH] test(library): read filtered shelf titles after the cards' frame The Library concept comparison read card titles as soon as the caption changed and the card count dropped below six. Production empties the shelf when a filter applies, writes the new caption when the page answers and places the cards in the next animation frame, so on a slow CI runner the empty shelf satisfied "fewer than six" and the titles read as []. Settle one frame pair before reading, as the Images and Inspector comparisons already do. --- tests/browser/library-concept.spec.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/browser/library-concept.spec.mjs b/tests/browser/library-concept.spec.mjs index 1589ad2..afc73ae 100644 --- a/tests/browser/library-concept.spec.mjs +++ b/tests/browser/library-concept.spec.mjs @@ -158,6 +158,10 @@ async function filteredOf(page,apply,undo) { await apply(); await expect.poll(()=>captionOf(page)).not.toBe(before); await expect.poll(()=>page.locator(CARDS).count()).toBeLessThan(CONCEPT_PROMPTS); + // Production empties the shelf when the filter applies, writes the answer's caption at once and places its cards + // in the next animation frame (one paint for a viewer), so the empty shelf already counts as "fewer": read the + // titles only after that frame, as the Images and Inspector comparisons do. + await settle(page); const result={caption:await captionOf(page),titles:await titlesOf(page)}; await undo(); await expect.poll(()=>captionOf(page)).toBe(before);