2024-07-15 08:44:28 +00:00
|
|
|
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,
|
|
|
|
});
|
2024-08-13 12:39:50 +00:00
|
|
|
cy.get('input[aria-label="Close"]').type('1000');
|
2024-07-15 08:44:28 +00: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' },
|
|
|
|
});
|
2024-08-13 12:39:50 +00:00
|
|
|
cy.get('input[aria-label="Close"]').type('1000');
|
2024-07-15 08:44:28 +00:00
|
|
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
|
|
|
cy.get(notification).should('contains.text', 'Data created');
|
|
|
|
});
|
|
|
|
});
|