refactor: refs #8440 update selector for delete note button in vehicle notes tests
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Jose Antonio Tubau 2025-03-12 09:29:00 +01:00
parent a703f9dac6
commit e61196f8be
1 changed files with 3 additions and 6 deletions

View File

@ -2,7 +2,7 @@ describe('Vehicle Notes', () => {
const selectors = {
addNoteInput: 'Add note here..._input',
saveNoteBtn: 'saveNote',
deleteNoteBtn: '[data-cy="notesRemoveNoteBtn"]',
deleteNoteBtn: 'notesRemoveNoteBtn',
noteCard: '.column.full-width > :nth-child(1) > .q-card__section--vert',
};
@ -16,16 +16,13 @@ describe('Vehicle Notes', () => {
});
it('Should add new note', () => {
cy.dataCy(selectors.addNoteInput)
.should('be.visible')
.click()
.type(newNoteText, { delay: 100 });
cy.dataCy(selectors.addNoteInput).should('be.visible').type(newNoteText);
cy.dataCy(selectors.saveNoteBtn).click();
cy.validateContent(selectors.noteCard, newNoteText);
});
it('Should delete note', () => {
cy.get(selectors.deleteNoteBtn).first().click();
cy.dataCy(selectors.deleteNoteBtn).first().click();
cy.get(selectors.noteCard).first().should('have.text', noteText);
});
});