salix-front/test/cypress/integration/property/propertyNotes.spec.js

27 lines
855 B
JavaScript

describe('Property notes', () => {
const selectors = {
addNoteInput: 'Add note here..._input',
saveNoteBtn: 'saveNote',
noteCard: '.column.full-width > :nth-child(1) > .q-card__section--vert',
};
const newNoteText = 'Cristal ventana salon roto';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('#/property/1/notes');
});
it('Should show the property notes', () => {
cy.get(selectors.noteCard)
.first()
.should('contain', 'Golpe en la puerta de entrada');
});
it('Should add a new note', () => {
cy.dataCy(selectors.addNoteInput).should('be.visible').type(newNoteText);
cy.dataCy(selectors.saveNoteBtn).click();
cy.get(selectors.noteCard).last().should('contain', newNoteText);
});
});