Merge branch '8600-CreateZoneE2E' of https://gitea.verdnatura.es/verdnatura/salix-front into 8600-CreateZoneE2E
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
PAU ROVIRA ROSALENY 2025-02-20 15:01:08 +01:00
commit 6304c53a3f
2 changed files with 13 additions and 11 deletions

View File

@ -17,9 +17,15 @@ describe('ZoneDeliveryDays', () => {
});
it('should query for delivery', () => {
cy.intercept('GET', /\/api\/Zones\/getEvents/).as('events');
cy.selectOption('[data-cy="ZoneDeliveryDaysPostcodeSelect"]', postcode);
cy.intercept('GET', /\/api\/Zones\/getEvents/, (req) => {
req.headers['cache-control'] = 'no-cache';
req.headers['pragma'] = 'no-cache';
req.headers['expires'] = '0';
req.on('response', (res) => {
delete res.headers['if-none-match'];
delete res.headers['if-modified-since'];
});
}).as('events');
cy.dataCy('ZoneDeliveryDaysPostcodeSelect').type(postcode);
cy.get('.q-menu .q-item').contains(postcode).click();
@ -48,9 +54,8 @@ describe('ZoneDeliveryDays', () => {
cy.get(submitForm).click();
cy.wait('@events').then((interception) => {
cy.log('interception: ', interception);
//TODO: interceptar llamada y comprobar que el objeto de los eventos no está vacío
// const data = interception.response.body;
// expect(data.hasComponentLack).to.equal(1);
const data = interception.response.body.events;
expect(data.length).to.be.greaterThan(0);
});
});
});

View File

@ -2,8 +2,7 @@ describe('ZoneWarehouse', () => {
const data = {
Warehouse: { val: 'Warehouse One', type: 'select' },
};
const dataError = 'ER_DUP_ENTRY: Duplicate entry';
const dataError = 'The introduced warehouse already exists';
const saveBtn = '.q-btn--standard > .q-btn__content > .block';
beforeEach(() => {
@ -18,7 +17,7 @@ describe('ZoneWarehouse', () => {
cy.get(saveBtn).click();
cy.checkNotification(dataError);
});
it('should create & remove a warehouse', () => {
cy.addBtnClick();
cy.fillInForm(data);
@ -26,7 +25,5 @@ describe('ZoneWarehouse', () => {
cy.get('.q-mt-lg > .q-btn--standard').click();
cy.get('tbody > :nth-child(2) > :nth-child(2) > .q-icon').click();
cy.get('[title="Confirm"]').click();
cy.reload();
});
});