fix: refs #7031 add test e2e
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Carlos Satorres 2024-12-05 08:28:43 +01:00
parent b4a4c4a0a4
commit cb15652dd6
1 changed files with 14 additions and 1 deletions

View File

@ -1,5 +1,6 @@
describe('ZoneBasicData', () => {
const notification = '.q-notification__message';
const priceBasicData = '[data-cy="Price_input"]';
beforeEach(() => {
cy.viewport(1280, 720);
@ -13,9 +14,21 @@ describe('ZoneBasicData', () => {
cy.get(notification).should('contains.text', "can't be blank");
});
it('should throw an error if the price is 0', () => {
cy.get(priceBasicData).type('0');
cy.get('.q-btn-group > .q-btn--standard').click();
cy.get(notification).should('Price must be greater than 0');
});
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(notification).should('contains.text', '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(notification).should('contains.text', 'Data saved');
cy.get(notification).should('Price must be greater than 0');
});
});