2024-07-15 08:44:28 +00:00
|
|
|
describe('ZoneWarehouse', () => {
|
|
|
|
const data = {
|
2024-12-18 10:22:04 +00:00
|
|
|
Warehouse: { val: 'Warehouse One', type: 'select' },
|
2024-07-15 08:44:28 +00:00
|
|
|
};
|
2024-12-18 10:22:04 +00:00
|
|
|
|
|
|
|
const dataError = 'ER_DUP_ENTRY: Duplicate entry';
|
|
|
|
const saveBtn = '.q-btn--standard > .q-btn__content > .block';
|
2024-07-15 08:44:28 +00:00
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.viewport(1280, 720);
|
|
|
|
cy.login('developer');
|
|
|
|
cy.visit(`/#/zone/2/warehouses`);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should throw an error if the warehouse chosen is already put in the zone', () => {
|
2024-12-18 10:22:04 +00:00
|
|
|
cy.addBtnClick();
|
|
|
|
cy.selectOption('[data-cy="Warehouse_select"]', 'Warehouse Two');
|
|
|
|
cy.get(saveBtn).click();
|
|
|
|
cy.checkNotification(dataError);
|
2024-07-15 08:44:28 +00:00
|
|
|
});
|
|
|
|
|
2024-12-18 10:22:04 +00:00
|
|
|
it('should create & remove a warehouse', () => {
|
|
|
|
cy.addBtnClick();
|
2024-07-15 08:44:28 +00:00
|
|
|
cy.fillInForm(data);
|
2024-12-18 10:22:04 +00:00
|
|
|
cy.get(saveBtn).click();
|
2024-07-15 08:44:28 +00:00
|
|
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
|
|
|
|
|
|
|
cy.get('tbody > :nth-child(2) > :nth-child(2) > .q-icon').click();
|
2024-12-18 10:22:04 +00:00
|
|
|
cy.get('[title="Confirm"]').click();
|
|
|
|
|
2024-07-15 08:44:28 +00:00
|
|
|
cy.reload();
|
|
|
|
});
|
|
|
|
});
|