diff --git a/test/cypress/integration/invoiceIn/invoiceInDescriptor.spec.js b/test/cypress/integration/invoiceIn/invoiceInDescriptor.spec.js index a0b5faf3b..5b88f1237 100644 --- a/test/cypress/integration/invoiceIn/invoiceInDescriptor.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInDescriptor.spec.js @@ -53,10 +53,10 @@ describe('InvoiceInDescriptor', () => { 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.validateDownload(() => cy.selectDescriptorOption(5)); + cy.selectDescriptorOption(5); }); }); @@ -84,7 +84,7 @@ describe('InvoiceInDescriptor', () => { 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(); redirect(originalId); }); diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 3c9c2ba68..e24624052 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -570,24 +570,6 @@ Cypress.Commands.add('validateCheckbox', (selector, expectedVal = 'true') => { 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) => { cy.window().then((win) => { cy.stub(win, 'open')