Skip to content

Commit

Permalink
feat: CQDG-887 add destroyOnClose on downloadFileManifestModal (#329)
Browse files Browse the repository at this point in the history
* feat: CQDG-887 add destroyOnClose on downloadFileManifestModal

* feat: CQDG-887 Adjust Cypress tests

---------

Co-authored-by: Karine St-Onge <[email protected]>
  • Loading branch information
atoulous and Karine St-Onge authored Oct 2, 2024
1 parent 43e4093 commit 0945ac9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/ManifestButton/PageDataExploration.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('Page Data Exploration (Data Files) - Bouton Manifest', () => {

it('Valider les fonctionnalités - Bouton Cancel', () => {
cy.get('[class="ant-modal-footer"] button[class*="ant-btn-default"]').click({force: true});
cy.get('[class*="DownloadFileManifestModal_modal"]').should('have.css', 'display', 'none');
cy.get('[class*="DownloadFileManifestModal_modal"]').should('not.exist');
cy.task('fileExists', `${Cypress.config('downloadsFolder')}`).then((exists) => {
assert.isTrue(!exists);
});
Expand All @@ -80,7 +80,7 @@ describe('Page Data Exploration (Data Files) - Bouton Manifest', () => {

it('Valider les fonctionnalités - Bouton Download', () => {
cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/file-manifest', 1, 1);
cy.get('[class*="DownloadFileManifestModal_modal"]').should('have.css', 'display', 'none');
cy.get('[class*="DownloadFileManifestModal_modal"]').should('not.exist');
cy.waitUntilFile(oneMinute);
cy.validateFileName('*.tsv');
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/ManifestButton/PageFile.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('Page d\'un fichier - Bouton Manifest', () => {

it('Valider les fonctionnalités - Bouton Cancel', () => {
cy.get('[class="ant-modal-footer"] button[class*="ant-btn-default"]').click({force: true});
cy.get('[class*="DownloadFileManifestModal_modal"]').should('have.css', 'display', 'none');
cy.get('[class*="DownloadFileManifestModal_modal"]').should('not.exist');
cy.task('fileExists', `${Cypress.config('downloadsFolder')}`).then((exists) => {
assert.isTrue(!exists);
});
Expand All @@ -80,7 +80,7 @@ describe('Page d\'un fichier - Bouton Manifest', () => {

it('Valider les fonctionnalités - Bouton Download', () => {
cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/file-manifest', 1, 1);
cy.get('[class*="DownloadFileManifestModal_modal"]').should('have.css', 'display', 'none');
cy.get('[class*="DownloadFileManifestModal_modal"]').should('not.exist');
cy.waitUntilFile(oneMinute);
cy.validateFileName('*.tsv');
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/ManifestButton/PageStudy.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('Page d\'une étude - Bouton Manifest', () => {

it('Valider les fonctionnalités - Bouton Cancel', () => {
cy.get('[class="ant-modal-footer"] button[class*="ant-btn-default"]').click({force: true});
cy.get('[class*="DownloadFileManifestModal_modal"]').should('have.css', 'display', 'none');
cy.get('[class*="DownloadFileManifestModal_modal"]').should('not.exist');
cy.task('fileExists', `${Cypress.config('downloadsFolder')}`).then((exists) => {
assert.isTrue(!exists);
});
Expand All @@ -91,7 +91,7 @@ describe('Page d\'une étude - Bouton Manifest', () => {

it('Valider les fonctionnalités - Bouton Download', () => {
cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/file-manifest', 1, 1);
cy.get('[class*="DownloadFileManifestModal_modal"]').should('have.css', 'display', 'none');
cy.get('[class*="DownloadFileManifestModal_modal"]').should('not.exist');
cy.waitUntilFile(oneMinute);
cy.validateFileName('*.tsv');
});
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/ManifestButton/PageStudyDataset.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('Page d\'une étude (Dataset) - Bouton Manifest', () => {

it('Valider les fonctionnalités - Bouton Cancel', () => {
cy.get('[class="ant-modal-footer"] button[class*="ant-btn-default"]').click({force: true});
cy.get('[class*="DownloadFileManifestModal_modal"]').should('have.css', 'display', 'none');
cy.get('[class*="DownloadFileManifestModal_modal"]').should('not.exist');
cy.task('fileExists', `${Cypress.config('downloadsFolder')}`).then((exists) => {
assert.isTrue(!exists);
});
Expand All @@ -91,7 +91,7 @@ describe('Page d\'une étude (Dataset) - Bouton Manifest', () => {

it('Valider les fonctionnalités - Bouton Download', () => {
cy.clickAndIntercept('[class="ant-modal-footer"] button[class*="ant-btn-primary"]', 'POST', '**/file-manifest', 1, 1);
cy.get('[class*="DownloadFileManifestModal_modal"]').should('have.css', 'display', 'none');
cy.get('[class*="DownloadFileManifestModal_modal"]').should('not.exist');
cy.waitUntilFile(oneMinute);
cy.validateFileName('*.tsv');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export const getDataTypeColumns = (): ProColumnType<any>[] => [

const FilesTable = ({ sqon }: { sqon: ISyntheticSqon }) => {
const config: AxiosRequestConfig = {
// @ts-ignore
url: REPORTS_ROUTES[ReportType.FILE_MANIFEST_STATS],
method: 'POST',
responseType: 'json',
Expand Down
1 change: 1 addition & 0 deletions src/components/reports/DownloadFileManifestModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ const DownloadFileManifestModal = ({
{!isIconButton && intl.get('api.report.fileManifest.button')}
</Button>
<Modal
destroyOnClose
open={isModalVisible}
title={intl.get('api.report.fileManifest.title')}
onCancel={handleClose}
Expand Down

0 comments on commit 0945ac9

Please sign in to comment.