salix-front/test/cypress/integration/zone/zoneList.spec.js

36 lines
1.3 KiB
JavaScript

describe('ZoneList', () => {
const agency = 'inhouse pickup';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('/#/zone/list');
});
it('should filter by agency', () => {
cy.dataCy('zoneFilterPanelAgencySelect').type(agency);
cy.get('.q-menu .q-item').contains(agency).click();
cy.get(':nth-child(1) > [data-col-field="agencyModeFk"]').should(
'include.text',
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');
});
});