salix-front/test/cypress/integration/shelving/shelvingBasicData.spec.js

27 lines
1.0 KiB
JavaScript
Raw Normal View History

/// <reference types="cypress" />
describe('ShelvingList', () => {
const parking = '.q-card > :nth-child(1) > .q-select > .q-field__inner > .q-field__control > .q-field__control-container';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/shelving/1/basic-data`);
});
it('should give an error if the code aldready exists', () => {
cy.dataCy('Code_input').should('exist').clear();
cy.dataCy('Code_input').type('AA7');
cy.saveCard();
cy.get('.q-notification__message').should('have.text', 'The code already exists');
});
it('should edit the data and save', () => {
cy.selectOption(parking, 'P-01-1');
cy.dataCy('Code_input').clear();
cy.dataCy('Code_input').type('AA1');
cy.dataCy('Priority_input').type('10');
cy.get(':nth-child(2) > .q-checkbox > .q-checkbox__inner').click();
cy.saveCard();
cy.get('.q-notification__message').should('have.text', 'Data saved');
});
});