diff --git a/tests/browser/navigation-thread-history.spec.mjs b/tests/browser/navigation-thread-history.spec.mjs index eb45cf5a..5b2da3ec 100644 --- a/tests/browser/navigation-thread-history.spec.mjs +++ b/tests/browser/navigation-thread-history.spec.mjs @@ -7,7 +7,21 @@ test("Back restores each thread visit before the previous channel", async ({ page, app, }) => { - await open(page, app); + const beta = page + .getByRole("navigation", { name: "Subscribed channels" }) + .locator('button[data-channel-id="beta"]'); + app.relay.holdUnread(); + try { + await open(page, app); + await expect.poll(() => app.report.unreadHolds.length).toBe(1); + await expect(beta).toHaveAccessibleName("Beta"); + } finally { + app.relay.releaseUnread(); + } + // Unread evidence changes the accessible name independently of navigation. + await expect(beta.getByRole("img")).toHaveAccessibleName( + "20 observed unread messages. Not an exact total.", + ); const roots = app.histories .get("primary/alpha") .filter((row) => row.content.startsWith("Thread root")); @@ -36,7 +50,7 @@ test("Back restores each thread visit before the previous channel", async ({ ); await expect(panel.getByText("Thread root 1", { exact: true })).toBeVisible(); expect(await openThread.evaluate((node) => node.isConnected)).toBe(true); - await page.getByRole("button", { name: "Beta", exact: true }).click(); + await beta.click(); await expect( page.getByRole("textbox", { name: "Message #Beta", exact: true }), ).toBeVisible(); diff --git a/tests/browser/notifications.spec.mjs b/tests/browser/notifications.spec.mjs index be402427..a64a3fae 100644 --- a/tests/browser/notifications.spec.mjs +++ b/tests/browser/notifications.spec.mjs @@ -7,6 +7,7 @@ test.use({ readState: true, threadUnread: true, pluginFixtures: true, + historyCounts: { alpha: 20, beta: 1 }, }); // Only the browser's OS boundary is replaced. The built host, session, @@ -240,12 +241,6 @@ for (const kind of ["mention", "thread reply"]) { }) => { // Model a real prior contribution in relay history, not a client-side // participation/readiness override. The incoming reply itself has no p tag. - // Keep this prior contribution inside the existing 500-event unread - // evidence window; the default 640-row Alpha fixture would crowd it out. - app.histories.set( - "primary/alpha", - app.histories.get("primary/alpha").slice(-200), - ); const root = kind === "thread reply" ? app.append("primary", "beta", "My prior thread", false)