Skip to content

Commit f432088

Browse files
loganjLarry
andauthored
main fix: pause the clock while an Activity-opened thread must stay unread (#548)
Signed-off-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz> Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
1 parent 6be39fd commit f432088

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎tests/browser/thread-unread.spec.mjs‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ test("thread buttons show observed unread independently, clear only after readin
5353
page,
5454
app,
5555
}, testInfo) => {
56-
// Reading needs a 300ms dwell (use-reading.ts). The clock runs that deadline
57-
// exactly where the test proves that something is not reading.
56+
// Reading needs a 300ms dwell (use-reading.ts). An installed clock still
57+
// flows, so pause it wherever an open surface must not earn that dwell, and
58+
// run the deadline exactly where the test proves reading.
5859
await page.clock.install();
5960
await holdReadingFocus(page);
6061
await open(page, app);
@@ -161,6 +162,10 @@ test("thread buttons show observed unread independently, clear only after readin
161162
.first();
162163
await item.focus();
163164
await expect(item).toBeFocused();
165+
// This open only proves the handoff. Its thread must stay unread, so a slow
166+
// close must not let the open panel earn reading dwell. Pause just ahead of
167+
// the page clock, which keeps flowing during the round trip.
168+
await page.clock.pauseAt((await page.evaluate(() => Date.now())) + 1000);
164169
await releaseReadingFocus(page);
165170
await item.press("Enter");
166171
await expect(
@@ -170,6 +175,7 @@ test("thread buttons show observed unread independently, clear only after readin
170175
.getByRole("button", { name: /^Close (?:thread|Thread tab)$/, exact: true })
171176
.click();
172177
await expect(alpha).toBeFocused();
178+
await page.clock.resume();
173179
const beforeRect = await first.boundingBox();
174180
await first.hover();
175181
const afterRect = await first.boundingBox();

0 commit comments

Comments
 (0)