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.
This commit is contained in:
1 parent
619fe9f9b9
commit
c463a4e03c
1 file changed
+23
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user