diff --git a/src/utils/reorderRows.test.ts b/src/utils/reorderRows.test.ts index 473e97d..528fdd5 100644 --- a/src/utils/reorderRows.test.ts +++ b/src/utils/reorderRows.test.ts @@ -86,6 +86,11 @@ describe("reorderRows — subtotals at the bottom (issue #424)", () => { expect(names(reorderRows(rows, false))).toEqual(["Vide", "z", "A"]); }); + it("a collapsed sub-group last in its group keeps its subtotal, before the group's own", () => { + const rows: Row[] = [sub("A", 0), leaf("z", 1), sub("Vide", 1)]; + expect(names(reorderRows(rows, false))).toEqual(["z", "Vide", "A"]); + }); + it("the same block, followed by a sibling root: the root closes after its own rows", () => { const block: Row[] = [sub("A", 0), sub("Vide", 1), leaf("z", 1)]; // A root group...