mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-07-29 03:41:16 -07:00
Allows the user to download CBG list (#318)
* adds initial download CBG box * componentize download packet, adds e2e tests * changes download file url in test to smaller size * improve testing functions * removes underline, colors icon * replace csv with zip for safari security issue
This commit is contained in:
parent
0316906a69
commit
33c3288160
10 changed files with 195 additions and 24 deletions
20
client/cypress/e2e/downloadPacket.spec.js
Normal file
20
client/cypress/e2e/downloadPacket.spec.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
// / <reference types="Cypress" />
|
||||
|
||||
describe('Census Block Group download', () => {
|
||||
it('validate file download', () => {
|
||||
cy.visit('localhost:8000/en/cejst');
|
||||
cy.get('#download-link').invoke('attr', 'target', '_blank');
|
||||
cy.intercept('https://justice40-data.s3.amazonaws.com/Score/usa.zip',
|
||||
{
|
||||
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/usa.csv`).should('exist');
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue