diff --git a/harness/tests/grouped.spec.js b/harness/tests/grouped.spec.js index a5fbd8df..55295ca5 100644 --- a/harness/tests/grouped.spec.js +++ b/harness/tests/grouped.spec.js @@ -146,18 +146,21 @@ test.describe("a grouped, multi-level document", () => { expect(await groupRows.locator("td").count()).toBe(0); await expect(groupRows.first().locator("th")).toHaveCount(1); - // The collapse is the document's, and it must have REMOVED rows: Upland's - // two regions are absent while Inland's two are here. Without this, a - // page that drew the indicator and ignored the frame would pass. + // The collapse is the document's: Upland's two regions are gone and the + // group is ONE row in their place (improvise-6qet, core.md ยง14). const labels = await page.locator("#grid tbody tr th[scope=row]").allTextContents(); expect(labels).toContain("East"); expect(labels).toContain("West"); + expect(labels).toContain("Upland"); expect(labels).not.toContain("Ridge"); expect(labels).not.toContain("Valley"); - // 4 regions visible x 2 stores. Stated as a count as well, because a row - // drawn with empty labels would satisfy the four assertions above. - await expect(page.locator("#grid tbody tr").filter({ hasNot: page.locator("th.group") })).toHaveCount( - 8, - ); + // (4 regions + the Upland fold) x 2 stores. A count too, because a row + // drawn with empty labels would satisfy the assertions above. + const dataRows = page.locator("#grid tbody tr").filter({ hasNot: page.locator("th.group") }); + await expect(dataRows).toHaveCount(10); + // The fold is an aggregate: no record carries Region=Upland, so nothing + // in its rows may open an editor, where a stored row beside it does. + await expect(dataRows.first().locator("td.editable")).not.toHaveCount(0); + await expect(dataRows.last().locator("td.editable")).toHaveCount(0); }); });