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

41 lines
1.1 KiB
JavaScript
Raw Permalink Normal View History

2023-11-09 09:29:28 +00:00
/// <reference types="cypress" />
describe('InvoiceInIntrastat', () => {
2024-08-09 08:47:15 +00:00
const firstRow = 'tbody > :nth-child(1)';
2023-11-09 09:29:28 +00:00
const thirdRow = 'tbody > :nth-child(3)';
2024-08-09 08:47:15 +00:00
const firstRowCode = `${firstRow} > :nth-child(2)`;
const firstRowAmount = `${firstRow} > :nth-child(3)`;
2023-11-09 09:29:28 +00:00
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/invoice-in/1/intrastat`);
});
it('should edit the first line', () => {
2024-08-09 08:47:15 +00:00
cy.selectOption(firstRowCode, 'Plantas vivas: Esqueje/injerto, Vid');
cy.get(firstRowAmount).clear();
2023-11-09 09:29:28 +00:00
cy.saveCard();
2024-08-09 08:47:15 +00:00
cy.get(`${firstRowCode} span`).should(
2024-07-05 13:41:53 +00:00
'have.text',
'6021010:Plantas vivas: Esqueje/injerto, Vid'
);
2023-11-09 09:29:28 +00:00
});
it('should add a new row', () => {
cy.addRow();
2024-07-05 13:41:53 +00:00
cy.fillRow(thirdRow, [
false,
'Plantas vivas: Esqueje/injerto, Vid',
30,
10,
5,
'FR',
]);
2023-11-09 09:29:28 +00:00
cy.saveCard();
cy.get('.q-notification__message').should('have.text', 'Data saved');
});
it('should remove the first line', () => {
2024-07-05 13:41:53 +00:00
cy.removeRow(1);
2023-11-09 09:29:28 +00:00
});
});