Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion cypress/e2e/data-publication/ModifiedLAR.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { onlyOn } from '@cypress/skip-test'
import { isBeta, isDev } from '../../support/helpers'
const { HOST } = Cypress.env()

const downloadsFolder = Cypress.config('downloadsFolder')

// add additional years here to test as needed
const years = [2024, 2023, 2022, 2021, 2020, 2019, 2018, 2017];

Expand Down Expand Up @@ -63,7 +65,14 @@ onlyOn(!isBeta(HOST), () => {
`/file/modifiedLar/year/${year}/institution/${institution}/txt`,
)
},
)
).click()

const fileName = `${institution}.txt`
// Read the downloaded file and confirm there are hella pipes in it (at least 50)
cy.readFile(`${downloadsFolder}/${fileName}`, { timeout: 10000 }).should((content) => {
const pipeCount = (content.match(/\|/g) || []).length
expect(pipeCount).to.be.greaterThan(50)
})

// Ticking the "Include Header" option updates download link appropriately
cy.get('#inclHeader').click()
Expand Down
4 changes: 2 additions & 2 deletions src/data-publication/reports/Results.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ class Results extends React.Component {
)

// Need to set filename since the File Proxy url no longer directly references the file name
let filename = institution.lei
let filename = normalizedInstitution.id
if (this.state.withHeader) filename += '_header'
filename += '.csv'
filename += '.txt'

return (
<li key={index}>
Expand Down