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
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
This commit is contained in:
parent
b38c8cde0d
commit
0251735c82
|
@ -66,8 +66,7 @@ describe('Vehicle DMS', () => {
|
||||||
cy.testDmsAction('create', formSelectors, data, 'Data saved');
|
cy.testDmsAction('create', formSelectors, data, 'Data saved');
|
||||||
});
|
});
|
||||||
|
|
||||||
it.only('Should download DMS', () => {
|
it('Should download DMS', () => {
|
||||||
cy.intercept('GET', /\/api\/dms\/\d+\/downloadFile/).as('download');
|
|
||||||
let fileName;
|
let fileName;
|
||||||
cy.get(selectors.firstRowId)
|
cy.get(selectors.firstRowId)
|
||||||
.invoke('text')
|
.invoke('text')
|
||||||
|
@ -75,10 +74,10 @@ describe('Vehicle DMS', () => {
|
||||||
label = label.trim();
|
label = label.trim();
|
||||||
fileName = `${label}.jpg`;
|
fileName = `${label}.jpg`;
|
||||||
});
|
});
|
||||||
|
cy.intercept('GET', /\/api\/dms\/\d+\/downloadFile/).as('download');
|
||||||
cy.get(selectors.firstRowDownloadBtn).click();
|
cy.get(selectors.firstRowDownloadBtn).click();
|
||||||
|
|
||||||
cy.wait('@download').then((interception) => {
|
cy.wait('@download').then((interception) => {
|
||||||
expect(interception.response.statusCode).to.equal(200);
|
|
||||||
expect(interception.response.headers['content-disposition']).to.contain(
|
expect(interception.response.headers['content-disposition']).to.contain(
|
||||||
fileName,
|
fileName,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue