test(derived): enter edit mode, and add the positive control
The screen opens read-only until the edit button is pressed, so the case asserted nothing about the column: no cell opened an editor. It now enters edit mode first, asserts the editor's absence directly rather than typing at whatever happens to be focused, and a sibling case proves a physical column in the same grid does open one - so the silence is about the column, not the screen. Mutating the mock to drop the READONLY rule fails the derived case and passes the physical one; restoring it passes both (5/5, ~48s).
This commit is contained in:
1 parent
f411b7d269
commit
d14395a0f8
1 file changed
+25
-7
@@ -78,14 +78,25 @@ context('derived variables: ', function () {
|
||||
|
||||
it('4 | a derived column does not accept an edit', () => {
|
||||
openEditor('TESTDATA.DERIVED_DEMO')
|
||||
enterEditMode()
|
||||
|
||||
getCellByHeaderAndRow(0, 'REGION')
|
||||
.dblclick({ force: true })
|
||||
.then(() => {
|
||||
// a read-only cell opens no editor, so nothing is focused to type into
|
||||
cy.focused().type('North{enter}')
|
||||
getCellByHeaderAndRow(0, 'REGION').should('have.text', 'West')
|
||||
})
|
||||
getCellByHeaderAndRow(0, 'REGION').dblclick({ force: true })
|
||||
// a read-only cell opens no editor at all, so there is nothing to type
|
||||
// into and the value cannot move
|
||||
cy.get('.handsontableInput').should('not.exist')
|
||||
getCellByHeaderAndRow(0, 'REGION').should('have.text', 'West')
|
||||
})
|
||||
|
||||
/**
|
||||
* The positive control for the case above: same screen, same edit mode, a
|
||||
* physical column - so its silence is about the column, not the screen.
|
||||
*/
|
||||
it('5 | a physical column in the same grid does accept an edit', () => {
|
||||
openEditor('TESTDATA.DERIVED_DEMO')
|
||||
enterEditMode()
|
||||
|
||||
getCellByHeaderAndRow(0, 'STATE').dblclick({ force: true })
|
||||
cy.get('.handsontableInput').should('exist')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -115,6 +126,13 @@ const openEditor = (libMem: string) => {
|
||||
cy.wait(2500)
|
||||
}
|
||||
|
||||
/** The EDIT screen opens read-only; this is the button that starts an edit. */
|
||||
const enterEditMode = () => {
|
||||
cy.get('.btnCtrl button.btn-primary', { timeout: longerCommandTimeout })
|
||||
.click()
|
||||
.then(() => cy.wait(2500))
|
||||
}
|
||||
|
||||
const openFilterPopup = () => {
|
||||
cy.contains('button.btnView', 'Filter', {
|
||||
timeout: longerCommandTimeout
|
||||
|
||||
Reference in new issue
Block a user