salix-front/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js

42 lines
1.4 KiB
JavaScript

/// <reference types="cypress" />
describe('InvoiceInIntrastat', () => {
const firstInstrastat = 'td[data-col-field="intrastatFk"][data-row-index="0"]';
const firstAmount = 'td[data-col-field="amount"][data-row-index="0"]';
const intrastat = 'Plantas vivas: Esqueje/injerto, Vid';
beforeEach(() => {
cy.login('administrative');
cy.visit(`/#/invoice-in/1/intrastat`);
});
it('should edit the first line', () => {
cy.get(firstInstrastat).click().type(`{selectall}{backspace}${intrastat}{enter}`);
cy.get(firstAmount).click().type('10{selectall}{backspace}20{enter}');
cy.saveCard();
cy.get(firstInstrastat).should('have.text', `6021010: ${intrastat}`);
});
it('should add a new row', () => {
cy.dataCy('vnTableCreateBtn').click();
cy.fillInForm(
{
'intrastat-code': {
val: 'Plantas vivas: Esqueje/injerto, Vid',
type: 'select',
},
Amount_input: '30',
Net_input: '10',
Stems_input: '5',
Country_select: { val: 'FR', type: 'select' },
},
{ attr: 'data-cy' },
);
cy.dataCy('FormModelPopup_save').click();
cy.get('.q-notification__message').should('have.text', 'Data created');
});
it('should remove the first line', () => {
cy.removeRow(1);
});
});