Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions tests/browser/navigation-thread-history.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -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();
Expand Down
7 changes: 1 addition & 6 deletions tests/browser/notifications.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
Loading