Merge branch 'dev' into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Alex Moreno 2025-05-07 05:36:55 +00:00
commit 876f40b4a3
2 changed files with 5 additions and 25 deletions

View File

@ -53,10 +53,10 @@ describe('InvoiceInDescriptor', { testIsolation: true }, () => {
expect(response.statusCode).to.equal(200); expect(response.statusCode).to.equal(200);
}); });
}); });
// https://redmine.verdnatura.es/issues/8767
it.skip('should download the file properly', () => { it('should download the file properly', () => {
cy.visit('/#/invoice-in/1/summary'); cy.visit('/#/invoice-in/1/summary');
cy.validateDownload(() => cy.selectDescriptorOption(5)); cy.selectDescriptorOption(5);
}); });
}); });
@ -84,7 +84,7 @@ describe('InvoiceInDescriptor', { testIsolation: true }, () => {
beforeEach(() => cy.visit(`/#/invoice-in/${originalId}/summary`)); beforeEach(() => cy.visit(`/#/invoice-in/${originalId}/summary`));
it.skip('should create a correcting invoice and redirect to original invoice', () => { it('should create a correcting invoice and redirect to original invoice', () => {
createCorrective(); createCorrective();
redirect(originalId); redirect(originalId);
}); });

View File

@ -194,9 +194,7 @@ Cypress.Commands.add('fillInForm', (obj, opts = {}) => {
cy.selectOption(el, val); cy.selectOption(el, val);
break; break;
case 'date': case 'date':
cy.get(el).type( cy.get(el).type(`{selectall}{backspace}${val}`).blur();
`{selectall}{backspace}${val}`,
).blur();
break; break;
case 'time': case 'time':
cy.get(el).click(); cy.get(el).click();
@ -571,24 +569,6 @@ Cypress.Commands.add('validateCheckbox', (selector, expectedVal = 'true') => {
cy.get(selector).should('have.attr', 'aria-checked', expectedVal.toString()); cy.get(selector).should('have.attr', 'aria-checked', expectedVal.toString());
}); });
Cypress.Commands.add('validateDownload', (trigger, opts = {}) => {
const {
url = /api\/dms\/\d+\/downloadFile\?access_token=.+/,
types = ['text/plain', 'image/jpeg'],
alias = 'download',
} = opts;
cy.intercept('GET', url).as(alias);
trigger().then(() => {
cy.wait(`@${alias}`).then(({ response }) => {
expect(response.statusCode).to.equal(200);
const isValidType = types.some((type) =>
response.headers['content-type'].includes(type),
);
expect(isValidType).to.be.true;
});
});
});
Cypress.Commands.add('validatePdfDownload', (match, trigger) => { Cypress.Commands.add('validatePdfDownload', (match, trigger) => {
cy.window().then((win) => { cy.window().then((win) => {
cy.stub(win, 'open') cy.stub(win, 'open')