mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-10-01 00:43:17 -07:00
* 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
20 lines
679 B
JavaScript
20 lines
679 B
JavaScript
// / <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');
|
|
});
|
|
});
|