fix: refs #8441 change test to allow downloading DMS files and ensure proper interception
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Jose Antonio Tubau 2025-04-25 09:47:05 +02:00
parent b38c8cde0d
commit 0251735c82
1 changed files with 2 additions and 3 deletions

View File

@ -66,8 +66,7 @@ describe('Vehicle DMS', () => {
cy.testDmsAction('create', formSelectors, data, 'Data saved');
});
it.only('Should download DMS', () => {
cy.intercept('GET', /\/api\/dms\/\d+\/downloadFile/).as('download');
it('Should download DMS', () => {
let fileName;
cy.get(selectors.firstRowId)
.invoke('text')
@ -75,10 +74,10 @@ describe('Vehicle DMS', () => {
label = label.trim();
fileName = `${label}.jpg`;
});
cy.intercept('GET', /\/api\/dms\/\d+\/downloadFile/).as('download');
cy.get(selectors.firstRowDownloadBtn).click();
cy.wait('@download').then((interception) => {
expect(interception.response.statusCode).to.equal(200);
expect(interception.response.headers['content-disposition']).to.contain(
fileName,
);