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