forked from verdnatura/salix-front
46 lines
1.3 KiB
JavaScript
46 lines
1.3 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' },
|
|
Close: {
|
|
val: {
|
|
h: '10',
|
|
m: '0',
|
|
x: 'PM',
|
|
},
|
|
type: 'time',
|
|
day: 11,
|
|
},
|
|
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('.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('.q-mt-lg > .q-btn--standard').click();
|
|
cy.get(notification).should('contains.text', 'Data created');
|
|
});
|
|
});
|