Merge pull request 'test(excel): guard that discarding a failed upload clears the red cells' (#427) from fix/122-discard-excel-clears-red-cells into release/7.22
Sites / deploy (push) Successful in 4m40s
Build / Build-and-ng-test (pull_request) Successful in 6m29s
Lighthouse Checks / lighthouse (pull_request) Failing after 7m36s
Build / Build-and-test-development (pull_request) Failing after 12m7s

Reviewed-on: #427
This commit was merged in pull request #427.
This commit is contained in:
allan committed 2026-11-01 14:49:51 +00:00
commit 2ee3c2241b
1 file changed
+40
+40
View File
@@ -419,6 +419,46 @@ context('excel tests: ', function () {
}) })
}) })
it('26 | Discarding an upload that fails validation clears the red cells', () => {
openTableFromTree(libraryToOpenIncludes, 'mpe_x_test')
// The loaded table's row count is what the grid must return to - the
// preview replaces the data source with the parsed file.
cy.get('h4.editor-title', { timeout: longerCommandTimeout })
.invoke('text')
.should('match', /\(\d+ rows?/)
.then((titleBefore) => {
const rowsBefore = titleBefore.match(/\(([\d,]+) rows?/)?.[1]
attachExcelFile('mixed_content_excel.xlsx', () => {
// The preview paints the cells that fail validation red - the state
// the user is looking at when they decide to abandon the file.
cy.get('#hotTable .htInvalid', {
timeout: longerCommandTimeout
}).should('have.length.greaterThan', 0)
cy.get('.buttonBar .btn-upload-preview.btn-outline-danger').click()
cy.get('clr-modal .modal-footer .btn-success-outline').click()
// Back to the loaded table, with no red cells left over. cancelEdit
// re-runs the HOT validation after restoring the data; without that
// the invalid cell meta survives the restore and the grid stays red.
cy.get('h4.editor-title', { timeout: longerCommandTimeout }).should(
'contain.text',
`(${rowsBefore} rows`
)
cy.get('#hotTable .htInvalid').should('not.exist')
// And the page is back in its normal read-only state, not the
// preview's button bar.
cy.get('.btnCtrl .btn-primary', {
timeout: longerCommandTimeout
}).should('contain.text', 'Edit')
})
})
})
// Large files break Cypress // Large files break Cypress
// it ('? | Uploads Excel with size of 5MB', (done) => { // it ('? | Uploads Excel with size of 5MB', (done) => {