fix: refs #8581 enable skipped tests in InvoiceInList for improved coverage
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Jorge Penadés 2025-02-24 18:16:06 +01:00
parent 7422d28d88
commit 5690fb1003
1 changed files with 84 additions and 9 deletions

View File

@ -20,7 +20,7 @@ describe('InvoiceInList', () => {
cy.get('#searchbar input').should('be.visible').type('{enter}'); cy.get('#searchbar input').should('be.visible').type('{enter}');
}); });
it.skip('should redirect on clicking a invoice', () => { it('should redirect on clicking a invoice', () => {
cy.get(firstId) cy.get(firstId)
.invoke('text') .invoke('text')
.then((content) => { .then((content) => {
@ -30,13 +30,13 @@ describe('InvoiceInList', () => {
}); });
}); });
it.skip('should open the details', () => { it('should open the details', () => {
cy.get(firstDetailBtn).click(); cy.get(firstDetailBtn).click();
cy.get(summaryHeaders).eq(1).contains('Basic data'); cy.get(summaryHeaders).eq(1).contains('Basic data');
cy.get(summaryHeaders).eq(4).contains('Vat'); cy.get(summaryHeaders).eq(4).contains('Vat');
}); });
it.skip('should create a new Invoice', () => { it('should create a new Invoice', () => {
cy.dataCy('vnTableCreateBtn').click(); cy.dataCy('vnTableCreateBtn').click();
cy.fillInForm(mock, { attr: 'data-cy' }); cy.fillInForm(mock, { attr: 'data-cy' });
cy.dataCy('FormModelPopup_save').click(); cy.dataCy('FormModelPopup_save').click();
@ -44,17 +44,14 @@ describe('InvoiceInList', () => {
cy.wait('@invoice').then(() => cy.wait('@invoice').then(() =>
cy.validateDescriptor({ cy.validateDescriptor({
title: mockInvoiceRef, title: mockInvoiceRef,
listBox: { listBox: { 0: '11/16/2001', 3: 'The farmer' },
0: '11/16/2001',
3: 'The farmer',
},
}), }),
); );
cy.get('[data-cy="vnLvCompany"]').should('contain.text', 'ORN'); cy.get('[data-cy="vnLvCompany"]').should('contain.text', 'ORN');
}); });
describe('right-panel', () => { describe('right-panel', () => {
it.skip('should filter by From param', () => { it('should filter by From param', () => {
cy.dataCy('From_inputDate').type('31/12/2000{enter}'); cy.dataCy('From_inputDate').type('31/12/2000{enter}');
cy.validateVnTableRows({ cy.validateVnTableRows({
cols: [ cols: [
@ -68,7 +65,7 @@ describe('InvoiceInList', () => {
}); });
}); });
it.skip('should filter by To param', () => { it('should filter by To param', () => {
cy.dataCy('To_inputDate').type('31/12/2000{enter}'); cy.dataCy('To_inputDate').type('31/12/2000{enter}');
cy.validateVnTableRows({ cy.validateVnTableRows({
cols: [ cols: [
@ -94,6 +91,84 @@ describe('InvoiceInList', () => {
}, },
], ],
}); });
cy.dataCy('vnFilterPanelChip_from').should('contain.text', '12/28/2000');
cy.dataCy('vnFilterPanelChip_to').should('contain.text', '01/01/2001');
});
it('should filter by supplierFk param', () => {
cy.selectOption('[data-cy="vnSupplierSelect"]', 'farmer king');
cy.dataCy('vnSupplierSelect').type('{enter}');
cy.validateVnTableRows({
cols: [{ name: 'supplierFk', val: 'Farmer King' }],
});
});
it('should filter by supplierRef param', () => {
cy.dataCy('Supplier ref_input').type('1234{enter}');
cy.intercept('GET', /\/api\/InvoiceIns\/\d+\/getTotals$/).as('invoice');
cy.wait('@invoice').then(() => cy.validateDescriptor({ title: '1234' }));
});
it('should filter by FI param', () => {
const plantsSlTaxNumber = '06089160W';
cy.dataCy('FI_input').type(`${plantsSlTaxNumber}{enter}`);
cy.validateVnTableRows({ cols: [{ name: 'supplierFk', val: 'plants sl' }] });
});
it('should filter by FI param', () => {
cy.dataCy('Serial_input').type('R');
cy.validateVnTableRows({ cols: [{ name: 'serial', val: 'r' }] });
});
it('should filter by account param', () => {
const supplierAccount = '4100000001';
cy.dataCy('Ledger account_input').type(`${supplierAccount}{enter}`);
cy.validateVnTableRows({ cols: [{ name: 'supplierFk', val: 'plants sl' }] });
});
it('should filter by AWB param', () => {
const awb = '22101929561';
cy.dataCy('AWB_input').type(`${awb}{enter}`);
cy.intercept('GET', /\/api\/InvoiceIns\/\d+\/getTotals$/).as('invoice');
cy.wait('@invoice').then(() => cy.validateDescriptor({ title: '1239' }));
});
it('should filter by amount param', () => {
cy.dataCy('Amount_input').type('64.23{enter}');
cy.intercept('GET', /\/api\/InvoiceIns\/\d+\/getTotals$/).as('invoice');
cy.wait('@invoice').then(() =>
cy.validateDescriptor({ listbox: { 2: '64.23' } }),
);
});
it('should filter by company param', () => {
cy.selectOption('[data-cy="Company_select"]', '442');
cy.dataCy('Company_select').type('{enter}');
cy.validateVnTableRows({
cols: [{ name: 'companyFk', val: 'vnl' }],
});
});
it('should filter by isBooked param', () => {
cy.dataCy('vnCheckboxIs booked').click();
cy.validateVnTableRows({
cols: [{ name: 'isBooked', val: 'check' }],
});
cy.dataCy('vnCheckboxIs booked').click();
cy.validateVnTableRows({
cols: [{ name: 'isBooked', val: 'close' }],
});
});
it('should filter by correctingFk param', () => {
cy.dataCy('vnCheckboxRectificative').click();
cy.get('[data-cy="vnTable"] .q-virtual-scroll__content')
.children()
.should('have.length', 0);
cy.dataCy('vnCheckboxRectificative').click();
cy.get('[data-cy="vnTable"] .q-virtual-scroll__content')
.children()
.should('have.length.gt', 0);
}); });
}); });
}); });