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

39 lines
1.2 KiB
JavaScript

describe('ZoneCreate', () => {
const notification = '.q-notification__message';
const data = {
Name: { val: 'Zone pickup D' },
Price: { val: '3' },
Bonus: { val: '0' },
'Traveling days': { val: '0' },
Warehouse: { val: 'Algemesi', type: 'select' },
Volumetric: { val: 'true', type: 'checkbox' },
};
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('/#/zone/list');
cy.get('.q-page-sticky > div > .q-btn').click();
});
it('should throw an error if an agency has not been selected', () => {
cy.fillInForm({
...data,
});
cy.get('input[aria-label="Close"]').type('10:00');
cy.get('.q-mt-lg > .q-btn--standard').click();
cy.get(notification).should('contains.text', 'Agency cannot be blank');
});
it('should create a zone', () => {
cy.fillInForm({
...data,
Agency: { val: 'inhouse pickup', type: 'select' },
});
cy.get('input[aria-label="Close"]').type('10:00');
cy.get('.q-mt-lg > .q-btn--standard').click();
cy.get(notification).should('contains.text', 'Data created');
});
});