feat: refs #8388 add filter options for intrastat table columns and update tests for row operations
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Jorge Penadés 2025-05-15 14:38:27 +02:00
parent 79e87833b9
commit cf64b7069b
2 changed files with 24 additions and 21 deletions

View File

@ -27,6 +27,7 @@ const columns = computed(() => [
'data-cy': 'intrastat-code', 'data-cy': 'intrastat-code',
sortBy: 'id', sortBy: 'id',
fields: ['id', 'description'], fields: ['id', 'description'],
filterOptions: ['id', 'description']
}, },
format: (row, dashIfEmpty) => dashIfEmpty(getCode(row)), format: (row, dashIfEmpty) => dashIfEmpty(getCode(row)),
create: true, create: true,

View File

@ -1,9 +1,8 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('InvoiceInIntrastat', () => { describe('InvoiceInIntrastat', () => {
const firstRow = 'tbody > :nth-child(1)'; const firstInstrastat = 'td[data-col-field="intrastatFk"][data-row-index="0"]';
const thirdRow = 'tbody > :nth-child(3)'; const firstAmount = 'td[data-col-field="amount"][data-row-index="0"]';
const codes = `[data-cy="intrastat-code"]`; const intrastat = 'Plantas vivas: Esqueje/injerto, Vid';
const firstRowAmount = `${firstRow} > :nth-child(3)`;
beforeEach(() => { beforeEach(() => {
cy.login('administrative'); cy.login('administrative');
@ -11,26 +10,29 @@ describe('InvoiceInIntrastat', () => {
}); });
it('should edit the first line', () => { it('should edit the first line', () => {
cy.selectOption(`${firstRow} ${codes}`, 'Plantas vivas: Esqueje/injerto, Vid'); cy.get(firstInstrastat).click().type(`{selectall}{backspace}${intrastat}{enter}`);
cy.get(firstRowAmount).clear(); cy.get(firstAmount).click().type('10{selectall}{backspace}20{enter}');
cy.saveCard(); cy.saveCard();
cy.get(codes) cy.get(firstInstrastat).should('have.text', `6021010: ${intrastat}`);
.eq(0)
.should('have.value', '6021010: Plantas vivas: Esqueje/injerto, Vid');
}); });
it('should add a new row', () => { it('should add a new row', () => {
cy.addRow(); cy.dataCy('vnTableCreateBtn').click();
cy.fillRow(thirdRow, [ cy.fillInForm(
false, {
'Plantas vivas: Esqueje/injerto, Vid', 'intrastat-code': {
30, val: 'Plantas vivas: Esqueje/injerto, Vid',
10, type: 'select',
5, },
'FR', Amount_input: '30',
]); Net_input: '10',
cy.saveCard(); Stems_input: '5',
cy.get('.q-notification__message').should('have.text', 'Data saved'); 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', () => { it('should remove the first line', () => {