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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user