From c463a4e03c34758ea43866cd85bf5f3aa41779c3 Mon Sep 17 00:00:00 2001 From: dc Date: Tue, 27 Oct 2026 22:21:52 +0000 Subject: [PATCH] test(editor): assert the derived block marker, not a column name derived-variables.cy.ts:97 expected dc-derived-first on the REGION header, because the comment assumed REGION opens the computed block. The grid follows MPE_DERIVED order, and that order is LINE_VALUE, REGION, REGION_LABEL - so the marker was on LINE_VALUE and correct. The spec asserted the wrong column, and the development pipeline has been red on it since. Dumping the header row on a local mock estate (sasjs/server desktop mode, RUN_TIMES=js) shows: 6 | LINE_VALUE | dc-derived-header dc-derived-first 7 | REGION | dc-derived-header 8 | REGION_LABEL | dc-derived-header beforeHiddenColumn htLastVisibleHeader and the same dump against the unmodified release/7.19 client, so this was never a client defect. The assertion now states the invariant instead: at least one derived header, the first of them opens the block, and no other one carries the marker. That holds whatever order the control table returns the variables in. --- client/cypress/e2e/derived-variables.cy.ts | 25 ++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/client/cypress/e2e/derived-variables.cy.ts b/client/cypress/e2e/derived-variables.cy.ts index 17b8454..f66d5b2 100644 --- a/client/cypress/e2e/derived-variables.cy.ts +++ b/client/cypress/e2e/derived-variables.cy.ts @@ -93,8 +93,29 @@ context('derived variables: ', function () { 'not.have.class', 'dc-derived-cell' ) - // REGION is the first derived column, so it opens the computed block - headerCell('REGION').should('have.class', 'dc-derived-first') + // The computed block opens at whichever derived column comes first in the + // grid - MPE_DERIVED order, so LINE_VALUE here, not REGION. Assert the + // invariant rather than a name: exactly one derived header carries the + // marker, and it is the first one. + cy.get('.ht_clone_top .htCore thead tr th').then(($ths) => { + const derived = [...$ths].filter((th) => + th.classList.contains('dc-derived-header') + ) + expect(derived.length, 'derived headers').to.be.greaterThan(0) + expect( + derived[0].classList.contains('dc-derived-first'), + 'the first derived header opens the block' + ).to.be.true + derived + .slice(1) + .forEach( + (th) => + expect( + th.classList.contains('dc-derived-first'), + 'only the first derived header carries the marker' + ).to.be.false + ) + }) // the hover text carries the label, which is what says what the column is: // the configured VAR_LABEL where there is one, otherwise the generated