fix: refs #8581 update Cypress test paths and improve download validation logic
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2025-03-12 10:22:17 +01:00
parent b86ba0c67b
commit fc0d409ab6
2 changed files with 9 additions and 8 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
find 'test/cypress/integration' \
find 'test/cypress/integration/invoiceIn/' \
-mindepth 1 \
-maxdepth 1 \
-type d | \

View File

@ -549,13 +549,14 @@ Cypress.Commands.add('validateDownload', (trigger, opts = {}) => {
alias = 'download',
} = opts;
cy.intercept('GET', url).as(alias);
trigger();
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;
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;
});
});
});