test: refs #7119 await fetching data
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
a3beba5906
commit
2ee2002876
|
@ -1,5 +1,6 @@
|
||||||
describe('ZoneBasicData', () => {
|
describe('ZoneBasicData', () => {
|
||||||
const priceBasicData = '[data-cy="Price_input"]';
|
const priceBasicData = '[data-cy="Price_input"]';
|
||||||
|
const saveBtn = '.q-btn-group > .q-btn--standard';
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1280, 720);
|
cy.viewport(1280, 720);
|
||||||
|
@ -8,20 +9,27 @@ describe('ZoneBasicData', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should throw an error if the name is empty', () => {
|
it('should throw an error if the name is empty', () => {
|
||||||
cy.get('[data-cy="zone-basic-data-name"] input').type('{selectall}{backspace}');
|
cy.intercept('GET', /\/api\/Zones\/4./).as('zone');
|
||||||
cy.get('.q-btn-group > .q-btn--standard').click();
|
|
||||||
|
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");
|
cy.checkNotification("can't be blank");
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should throw an error if the price is empty', () => {
|
it('should throw an error if the price is empty', () => {
|
||||||
cy.get(priceBasicData).clear();
|
cy.get(priceBasicData).clear();
|
||||||
cy.get('.q-btn-group > .q-btn--standard').click();
|
cy.get(saveBtn).click();
|
||||||
cy.checkNotification('cannot be blank');
|
cy.checkNotification('cannot be blank');
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should edit the basicData's zone", () => {
|
it("should edit the basicData's zone", () => {
|
||||||
cy.get('.q-card > :nth-child(1)').type(' modified');
|
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');
|
cy.checkNotification('Data saved');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue