Adds download packet to methodology page (Sprint 4 designs) (#578)

* adds responsive download packet

* adds tests and intl
This commit is contained in:
Vim 2021-09-07 10:08:13 -07:00 committed by GitHub
commit b3f63c29f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 118 additions and 79 deletions

View file

@ -2,22 +2,21 @@
describe('Census Block Group download', () => {
it('validate file download', () => {
// const filename = `usa.zip`;
cy.visit('localhost:8000/en/cejst');
const filename = `Screening+Tool+Data.zip`;
cy.visit('localhost:8000/en/methodology');
// Todo VS: Download packet component is being moved. Will be re-enabled with
// cy.get('#download-link').invoke('attr', 'target', '_blank');
// cy.intercept(`https://justice40-data.s3.amazonaws.com/Score/${filename}`,
// {
// body: 'success',
// headers: {
// 'Content-Type': 'text/html; charset=utf-8',
// 'Content-Disposition': 'attachment',
// },
// },
// ).as('downloadRequest');
// cy.get('button[class*="downloadPacket"]').click();
// cy.wait('@downloadRequest');
// cy.readFile(`cypress/downloads/${filename}`).should('exist');
cy.get('[data-cy="download-link"]').invoke('attr', 'target', '_blank');
cy.intercept(`https://justice40-data.s3.amazonaws.com/data-pipeline/data/score/downloadable/${filename}`,
{
body: 'success',
headers: {
'Content-Type': 'text/html; charset=utf-8',
'Content-Disposition': 'attachment',
},
},
).as('downloadRequest');
cy.get('button[class*="downloadPacket"]').click();
cy.wait('@downloadRequest');
cy.readFile(`cypress/downloads/${filename}`).should('exist');
});
});