From 216b14860d9b8f2de896c981033b9e12afe6ba4c Mon Sep 17 00:00:00 2001 From: Edward Langley Date: Tue, 22 Sep 2026 21:31:06 -0700 Subject: [PATCH] improvise-6qet: the grouped harness spec expects the collapsed group's row grouped.spec.js asserted a collapsed group contributes no rows (8 data rows). It now contributes one per Store (10), labelled Upland, and its cells are not editable. The editable assertion was checked against cell_id without folds_a_group: it fails with 6 editable cells where 0 are expected. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01VdfEGXA7aJ6ftMsCc9PJze --- harness/tests/grouped.spec.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) 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); }); });