fix: refs #6643 fix tests
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-01-10 14:01:36 +01:00
parent 2555d2b2d1
commit 315c089936
1 changed files with 7 additions and 10 deletions

View File

@ -138,23 +138,20 @@ Cypress.Commands.add('validateRow', (rowSelector, expectedValues) => {
Cypress.Commands.add('removeRow', (rowIndex) => { Cypress.Commands.add('removeRow', (rowIndex) => {
let rowsBefore; let rowsBefore;
let rowsAfter; cy.get('tbody > tr:visible')
cy.get('tr')
.its('length') .its('length')
.then((length) => { .then((length) => {
rowsBefore = length;
cy.get('.q-checkbox').eq(rowIndex).click(); cy.get('.q-checkbox').eq(rowIndex).click();
cy.removeCard(); cy.removeCard();
cy.get('.q-dialog button').eq(2).click(); cy.get('.q-dialog button').eq(2).click();
rowsBefore = length;
}) })
.then(() => { .then(() => {
cy.get('tr') // Check the existence of tbody before performing the second assertion.
.its('length') cy.get('tbody').then(($tbody) => {
.then((length) => { if ($tbody.length > 0)
rowsAfter = length; cy.get('tbody > tr:visible').should('have.length', rowsBefore - 1);
expect(rowsBefore).to.eq(rowsAfter + 1); });
});
}); });
}); });
Cypress.Commands.add('openListSummary', (row) => { Cypress.Commands.add('openListSummary', (row) => {