Merge branch '8600-CreateZoneE2E' of https://gitea.verdnatura.es/verdnatura/salix-front into 8600-CreateZoneE2E
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Jon Elias 2025-02-24 12:29:20 +01:00
commit a08e944dbb
4 changed files with 81 additions and 6 deletions

View File

@ -36,13 +36,13 @@ function openConfirmDialog(callback) {
}
</script>
<template>
<QItem @click="openConfirmDialog('remove')" v-ripple clickable>
<QItem @click="openConfirmDialog('remove')" v-ripple clickable data-cy="Delete_button">
<QItemSection avatar>
<QIcon name="delete" />
</QItemSection>
<QItemSection>{{ t('deleteZone') }}</QItemSection>
</QItem>
<QItem @click="openConfirmDialog('clone')" v-ripple clickable>
<QItem @click="openConfirmDialog('clone')" v-ripple clickable data-cy="Clone_button">
<QItemSection avatar>
<QIcon name="content_copy" />
</QItemSection>

View File

@ -7,10 +7,6 @@ describe('ZoneList', () => {
});
it('should filter by agency', () => {
cy.dataCy('zoneFilterPanelNameInput').type('{downArrow}{enter}');
});
it('should open the zone summary', () => {
cy.dataCy('zoneFilterPanelAgencySelect').type(agency);
cy.get('.q-menu .q-item').contains(agency).click();
cy.get(':nth-child(1) > [data-col-field="agencyModeFk"]').should(
@ -18,4 +14,22 @@ describe('ZoneList', () => {
agency,
);
});
it('should open the zone summary', () => {
cy.dataCy('zoneFilterPanelAgencySelect').type(agency);
cy.get('.q-menu .q-item').contains(agency).click();
cy.dataCy('tableAction-0').eq(1).click();
cy.get('.header > .q-icon').click();
cy.url().should('include', 'zone/2/summary');
});
it('should clone the zone', () => {
cy.get('.router-link-active > .q-icon').click();
cy.dataCy('tableAction-1').eq(1).click();
cy.dataCy('VnConfirm_confirm').click();
cy.url().should('not.include', 'zone/2/');
cy.url().should('match', /zone\/\d+\/basic-data/);
cy.get('.list-box > :nth-child(1)').should('include.text', agency);
cy.get('.title > span').should('include.text', 'Zone pickup B');
});
});

View File

@ -0,0 +1,23 @@
describe('ZoneLocations', () => {
const data = {
Warehouse: { val: 'Warehouse One', type: 'select' },
};
const postalCode = '[style=""] > :nth-child(1) > :nth-child(1) > :nth-child(2) > :nth-child(1) > :nth-child(1) > :nth-child(2) > :nth-child(1) > .q-tree__node--parent > .q-tree__node-collapsible > .q-tree__children'
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit(`/#/zone/2/location`);
});
it('should show all locations on entry', () => {
cy.get('.q-tree > :nth-child(1) > :nth-child(2) > :nth-child(1)').children().should('have.length', 9);
});
it('should be able to search by postal code', () => {
cy.get('#searchbarForm').type('46680');
cy.get('.router-link-active > .q-icon').click();
cy.get(postalCode).should('include.text', '46680')
});
});

View File

@ -0,0 +1,38 @@
describe('ZoneSummary', () => {
const agency = 'inhouse pickup';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('/#/zone/2/summary');
});
it('should redirect to basic data', () =>{
cy.get(':nth-child(1) > .q-pb-md > .header-link > .link').click();
cy.url().should('include', 'zone/2/basic-data');
});
it('should redirect to warehouses', () =>{
cy.get('.full-width > .q-pb-md > .header-link > .link').click();
cy.url().should('include', 'zone/2/warehouses');
});
it('should clone the zone', () => {
cy.dataCy('descriptor-more-opts').click();
cy.dataCy('Clone_button').click();
cy.dataCy('VnConfirm_confirm').click();
cy.url().should('not.include', 'zone/2/');
cy.url().should('match', /zone\/\d+\/basic-data/);
cy.get('.list-box > :nth-child(1)').should('include.text', agency);
cy.get('.title > span').should('include.text', 'Zone pickup B');
});
it('should delete the zone', () => {
cy.dataCy('descriptor-more-opts').click();
cy.dataCy('Delete_button').click();
cy.dataCy('VnConfirm_confirm').click();
cy.url().should('include', '/zone/list');
cy.get('.q-notification__message').should('have.text', 'Zone deleted');
});
});