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:
Vim 2021-07-15 11:01:10 -07:00 committed by GitHub
commit 33c3288160
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 195 additions and 24 deletions

View 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');
});
});