test: refs #7119 await fetching data
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2025-01-29 17:46:33 +01:00
parent a3beba5906
commit 2ee2002876
1 changed files with 12 additions and 4 deletions

View File

@ -1,5 +1,6 @@
describe('ZoneBasicData', () => {
const priceBasicData = '[data-cy="Price_input"]';
const saveBtn = '.q-btn-group > .q-btn--standard';
beforeEach(() => {
cy.viewport(1280, 720);
@ -8,20 +9,27 @@ describe('ZoneBasicData', () => {
});
it('should throw an error if the name is empty', () => {
cy.get('[data-cy="zone-basic-data-name"] input').type('{selectall}{backspace}');
cy.get('.q-btn-group > .q-btn--standard').click();
cy.intercept('GET', /\/api\/Zones\/4./).as('zone');
cy.wait('@zone').then(() => {
cy.get('[data-cy="zone-basic-data-name"] input').type(
'{selectall}{backspace}',
);
});
cy.get(saveBtn).click();
cy.checkNotification("can't be blank");
});
it('should throw an error if the price is empty', () => {
cy.get(priceBasicData).clear();
cy.get('.q-btn-group > .q-btn--standard').click();
cy.get(saveBtn).click();
cy.checkNotification('cannot be blank');
});
it("should edit the basicData's zone", () => {
cy.get('.q-card > :nth-child(1)').type(' modified');
cy.get('.q-btn-group > .q-btn--standard').click();
cy.get(saveBtn).click();
cy.checkNotification('Data saved');
});
});