33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
/// <reference types="cypress" />
|
|
describe('ParkingBasicData', () => {
|
|
const codeInput = 'form .q-card .q-input input';
|
|
const sectorSelect = 'form .q-card .q-select';
|
|
beforeEach(() => {
|
|
cy.login('developer');
|
|
cy.visit(`/#/shelving/parking/1/basic-data`);
|
|
cy.get('[data-cy="navBar-spinner"]', { timeout: 10000 }).should('not.be.visible');
|
|
});
|
|
|
|
it('should give an error if the code aldready exists', () => {
|
|
cy.get(codeInput).eq(0).should('have.value', '700-01').clear();
|
|
cy.get(codeInput).eq(0).type('700-02');
|
|
cy.saveCard();
|
|
cy.checkNotification('The code already exists');
|
|
});
|
|
|
|
it('should edit the code and sector', () => {
|
|
cy.selectOption(sectorSelect, 'First');
|
|
|
|
cy.get(codeInput).eq(0).clear();
|
|
cy.get(codeInput).eq(0).type('700-01');
|
|
cy.dataCy('Picking order_input').clear().type(80230);
|
|
|
|
cy.saveCard();
|
|
cy.checkNotification('Data saved');
|
|
|
|
cy.get(sectorSelect).contains('First sector');
|
|
cy.get(codeInput).should('have.value', '700-01');
|
|
cy.dataCy('Picking order_input').should('have.value', 80230);
|
|
});
|
|
});
|