Skip to content

Commit

Permalink
FDG-9110 add test for download links
Browse files Browse the repository at this point in the history
  • Loading branch information
nicweidner committed Jan 6, 2025
1 parent 79f029d commit 2428d3e
Showing 1 changed file with 21 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('About Us interaction flow', () => {
describe('About Us Links interaction flow', () => {
beforeEach(() => {
cy.visit('/about-us/');
});
Expand Down Expand Up @@ -46,12 +46,6 @@ describe('About Us interaction flow', () => {
'https://www.imf.org/en/About/Factsheets/Sheets/2023/Standards-for-data-dissemination#:~:text=The%20Special%20Data%20Dissemination%20System,access%20to%20international%20capital%20markets.',
external: true,
},
// because there's a dataset search in the main nav
// {
// name: 'Dataset Search',
// url: 'datasets/',
// external: false,
// },
{
name: 'API Documentation',
url: 'api-documentation/',
Expand Down Expand Up @@ -113,26 +107,24 @@ describe('About Us interaction flow', () => {
});
});

// it('Validates download links', () => {
// const downloadLinks: object[] = [
// {
// name: 'Open Data Policy',
// url: 'about-us/901-1%20Open%20Data%20Policy.pdf',
// external: false,
// },
// {
// name: 'https://fiscaldata.treasury.gov/static-data/reports-statements/mts/imf/cgd.xml',
// url: 'static-data/reports-statements/mts/imf/cgd.xml',
// external: false,
// },
// {
// name: 'https://fiscaldata.treasury.gov/static-data/reports-statements/mts/imf/cgo.xml',
// url: 'static-data/reports-statements/mts/imf/cgo.xml',
// external: false,
// },
// ];
//
// const downloadsFolder = Cypress.config('downloadsFolder');
// cy.readFile('https://fiscaldata.treasury.gov/static-data/reports-statements/mts/imf/cgd.xml');
// });
it('Validates download links', () => {
const downloadLinks: object[] = [
{
name: 'Open Data Policy',
url: '/data/about-us/901-1 Open Data Policy.pdf',
},
{
name: 'https://fiscaldata.treasury.gov/static-data/reports-statements/mts/imf/cgd.xml',
url: 'https://fiscaldata.treasury.gov/static-data/reports-statements/mts/imf/cgd.xml',
},
{
name: 'https://fiscaldata.treasury.gov/static-data/reports-statements/mts/imf/cgo.xml',
url: 'https://fiscaldata.treasury.gov/static-data/reports-statements/mts/imf/cgo.xml',
},
];

downloadLinks.forEach(link => {
cy.findByRole('link', { name: link.name }).should('have.attr', 'href', link.url);
});
});
});

0 comments on commit 2428d3e

Please sign in to comment.