commit 59a2dcf32c8535821ec2506d5e556c50814432d7
parent cc48ac86cf9d597b578e0bd83879e997f64b420b
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Sat, 14 Nov 2026 15:42:52 -0500
site-nav: channel-find spec counts group cards, not every nested details
"Advanced options" is a nested <details> too; the count goes by the group's
select-all box.
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/export/e2e/channel-find.spec.ts b/export/e2e/channel-find.spec.ts
@@ -114,7 +114,16 @@ async function waitForHydration(page: Page) {
}
function groupCard(page: Page, name: string) {
- return page.locator("details details").filter({ hasText: name });
+ return groupCards(page).filter({ hasText: name });
+}
+
+// Every group card, and only group cards: "Advanced options" (and a tag
+// disclosure) is a nested <details> too, so the count goes by the group's
+// select-all box.
+function groupCards(page: Page) {
+ return page
+ .locator("details details")
+ .filter({ has: page.getByRole("checkbox", { name: /^Select all in / }) });
}
function memberCheckbox(page: Page, group: string, channel: string) {
@@ -145,7 +154,7 @@ test.describe("channel finder", () => {
await expect(page.getByText("14 of 14 channels")).toBeVisible();
// A multi-group site starts with every group folded.
- await expect(page.locator("details details[open]")).toHaveCount(0);
+ await expect(groupCards(page).and(page.locator("details[open]"))).toHaveCount(0);
const where = await opener(page).boundingBox();
await page.getByTestId("filters-panel").screenshot({
path: testInfo.outputPath("channel-find-closed-desktop.png"),
@@ -160,7 +169,7 @@ test.describe("channel finder", () => {
// A channel name: its group alone, open, listing that channel alone.
await field(page).fill("gamma");
- await expect(page.locator("details details")).toHaveCount(1);
+ await expect(groupCards(page)).toHaveCount(1);
await expect(groupCard(page, "Group One")).toHaveAttribute("open", "");
await expect(memberCheckbox(page, "Group One", "Gamma Talk")).toBeVisible();
await expect(memberCheckbox(page, "Group One", "Alpha Works")).toHaveCount(0);
@@ -177,7 +186,7 @@ test.describe("channel finder", () => {
// A group name: the whole group.
await field(page).fill("reviewer");
- await expect(page.locator("details details")).toHaveCount(1);
+ await expect(groupCards(page)).toHaveCount(1);
await expect(groupCard(page, "Reviewers").getByRole("checkbox")).toHaveCount(5);
await page.getByTestId("filters-panel").screenshot({
path: testInfo.outputPath("channel-find-open-desktop.png"),
@@ -186,14 +195,14 @@ test.describe("channel finder", () => {
// Nothing: said, not a blank panel.
await field(page).fill("no such thing");
await expect(page.getByTestId("channel-find-empty")).toContainText("no such thing");
- await expect(page.locator("details details")).toHaveCount(0);
+ await expect(groupCards(page)).toHaveCount(0);
// Esc: cleared, closed, focus back on the magnifier, the folded panel back.
await field(page).press("Escape");
await expect(field(page)).toHaveCount(0);
await expect(opener(page)).toBeFocused();
- await expect(page.locator("details details")).toHaveCount(4);
- await expect(page.locator("details details[open]")).toHaveCount(0);
+ await expect(groupCards(page)).toHaveCount(4);
+ await expect(groupCards(page).and(page.locator("details[open]"))).toHaveCount(0);
});
test("keyboard: Enter opens it, a channel toggles from the found list", async ({
@@ -216,7 +225,7 @@ test.describe("channel finder", () => {
await field(page).fill("");
await field(page).press("Escape");
await expect(page.getByText("13 of 14 channels")).toBeVisible();
- await expect(page.locator("details details[open]")).toHaveCount(0);
+ await expect(groupCards(page).and(page.locator("details[open]"))).toHaveCount(0);
});
test.describe("on a phone", () => {