54 lines
1.8 KiB
JavaScript
54 lines
1.8 KiB
JavaScript
|
/// <reference types="cypress" />
|
||
|
describe('InvoiceInBasicData', () => {
|
||
|
const selects = '.q-form .q-select';
|
||
|
const appendBtns = 'label button';
|
||
|
const dialogAppendBtns = '.q-dialog label button';
|
||
|
const dialogInputs = '.q-dialog input';
|
||
|
const dialogActionBtns = '.q-card__actions button';
|
||
|
|
||
|
beforeEach(() => {
|
||
|
cy.login('developer');
|
||
|
cy.visit(`/#/invoice-in/1/basic-data`);
|
||
|
});
|
||
|
|
||
|
it('should edit the provideer and supplier ref', () => {
|
||
|
cy.get(selects).eq(0).click();
|
||
|
cy.get(selects).eq(0).type('Bros');
|
||
|
cy.get(selects).eq(0).type('{enter}');
|
||
|
|
||
|
cy.get(appendBtns).eq(0).click();
|
||
|
cy.get('input').eq(2).type(4739);
|
||
|
cy.saveCard();
|
||
|
|
||
|
cy.get(`${selects} input`).eq(0).invoke('val').should('eq', 'Bros nick');
|
||
|
cy.get('input').eq(2).invoke('val').should('eq', '4739');
|
||
|
});
|
||
|
|
||
|
it('should edit the dms data', () => {
|
||
|
const firtsInput = 'Ticket:65';
|
||
|
const secondInput = "I don't know what posting here!";
|
||
|
|
||
|
cy.get(appendBtns).eq(3).click();
|
||
|
cy.get(dialogAppendBtns).eq(0).click();
|
||
|
cy.get(dialogInputs).eq(0).type(firtsInput);
|
||
|
cy.get(dialogAppendBtns).eq(1).click();
|
||
|
cy.get('textarea').type(secondInput);
|
||
|
cy.get(dialogActionBtns).eq(1).click();
|
||
|
|
||
|
cy.get(appendBtns).eq(3).click();
|
||
|
|
||
|
cy.get(dialogInputs).eq(0).invoke('val').should('eq', firtsInput);
|
||
|
cy.get('textarea').invoke('val').should('eq', secondInput);
|
||
|
});
|
||
|
|
||
|
it('should throw an error creating a new dms if a file is not attached', () => {
|
||
|
cy.get(appendBtns).eq(2).click();
|
||
|
cy.get(appendBtns).eq(1).click();
|
||
|
cy.get(dialogActionBtns).eq(1).click();
|
||
|
cy.get('.q-notification__message').should(
|
||
|
'have.text',
|
||
|
"The files can't be empty"
|
||
|
);
|
||
|
});
|
||
|
});
|