diff --git a/client/cypress/integration/About.feature b/client/cypress/integration/About.feature index 4623ff48..da3e61f4 100644 --- a/client/cypress/integration/About.feature +++ b/client/cypress/integration/About.feature @@ -1,17 +1,17 @@ Feature: Does the About page open? I want to open the about page - Scenario: About page from Explore Tool page + Scenario: About page FROM Explore Tool page Given I am on the Explore Tool page When I click on the "About" page in the navigation Then I see "About" in the title - Scenario: About page from Methodology page + Scenario: About page FROM Methodology page Given I am on the Explore Tool page When I click on the "Methodology" page in the navigation Then I see "Data and Methodology" in the title - Scenario: About page from Contact page + Scenario: About page FROM Contact page Given I am on the Explore Tool page When I click on the "Contact" page in the navigation Then I see "Contact" in the title \ No newline at end of file diff --git a/client/cypress/integration/LegacyTests/accessibility.test.js b/client/cypress/integration/LegacyTests/accessibility.test.js index 5bf18636..7b7cc628 100644 --- a/client/cypress/integration/LegacyTests/accessibility.test.js +++ b/client/cypress/integration/LegacyTests/accessibility.test.js @@ -47,9 +47,9 @@ function terminalLog(violations) { } -describe('Accessibility checks', () => { +describe('Do the accessibility checks pass on each page?', () => { endpoints.forEach((endpoint) => { - it(`Check Accessibility on ${endpoint} page`, () => { + it(`Check accessibility on ${endpoint} page`, () => { cy.visit(endpoint).get('main').then(() => { cy.injectAxe(); cy.checkA11y(null, null, terminalLog); diff --git a/client/cypress/integration/LegacyTests/allLinks.spec.js b/client/cypress/integration/LegacyTests/allLinks.spec.js new file mode 100644 index 00000000..1e398d3c --- /dev/null +++ b/client/cypress/integration/LegacyTests/allLinks.spec.js @@ -0,0 +1,22 @@ +// / + +describe('Do all the English pages have all links with a defined href attribute?', () => { + const pages = [ + '/', + 'cejst', + 'methodology', + 'contact', + ]; + + pages.forEach((page) => { + it(`test all href attr on ${page} page`, () => { + cy.visit(page); + + // Checks to make sure all a tags have an href: + cy.get('a').each(($a) => { + const message = $a.text(); + expect($a, message).to.have.attr('href').not.contain('undefined'); + }); + }); + }); +}); diff --git a/client/cypress/integration/LegacyTests/downloadPacket.spec.js b/client/cypress/integration/LegacyTests/downloadPacket.spec.js index e862bef7..18973032 100644 --- a/client/cypress/integration/LegacyTests/downloadPacket.spec.js +++ b/client/cypress/integration/LegacyTests/downloadPacket.spec.js @@ -1,13 +1,14 @@ // / -describe('Census Block Group packet download', () => { +describe('Does the Census Block Group packet download?', () => { const filename = `Screening_Tool_Data.zip`; it('validate file download', () => { cy.visit('localhost:8000/en/methodology'); cy.get('[data-cy="download-link"]').invoke('attr', 'target', '_blank'); - cy.intercept(`https://d3jqyw10j8e7p9.cloudfront.net/data-pipeline/data/score/downloadable/${filename}`, + cy.intercept('GET', '/data-pipeline/data/score/downloadable/Screening_Tool_Data.zip', { + hostname: 'https://d3jqyw10j8e7p9.cloudfront.net', body: 'success', headers: { 'Content-Type': 'text/html; charset=utf-8', diff --git a/client/cypress/integration/LegacyTests/exploreToolPage.spec.js b/client/cypress/integration/LegacyTests/exploreToolPage.spec.js deleted file mode 100644 index 96921d05..00000000 --- a/client/cypress/integration/LegacyTests/exploreToolPage.spec.js +++ /dev/null @@ -1,13 +0,0 @@ -// / - -describe('tests links on Explore Tool Page', () => { - it('validate file download', () => { - cy.visit('localhost:8000/en/cejst'); - - // Checks to make sure all a tags have an href: - cy.get('a').each(($a) => { - const message = $a.text(); - expect($a, message).to.have.attr('href').not.contain('undefined'); - }); - }); -}); diff --git a/client/cypress/integration/LegacyTests/language.spec.js b/client/cypress/integration/LegacyTests/language.spec.js index 95672681..a5162727 100644 --- a/client/cypress/integration/LegacyTests/language.spec.js +++ b/client/cypress/integration/LegacyTests/language.spec.js @@ -4,7 +4,7 @@ describe('Translation Test', () => { it('Sets default language to /en and redirects', () => { cy.visit('http://localhost:8000'); cy.url().should('include', '/en/'); - cy.get('[data-cy=about-screen-tool-heading]').contains('About the screening tool'); + cy.get('[data-cy=about-page-heading]').contains('About'); }); // Todo VS: Understand how to create es content diff --git a/client/cypress/integration/LegacyTests/latlngurl.spec.js b/client/cypress/integration/LegacyTests/mapZoomLatLong.spec.js similarity index 74% rename from client/cypress/integration/LegacyTests/latlngurl.spec.js rename to client/cypress/integration/LegacyTests/mapZoomLatLong.spec.js index d7fce3a7..f7ec4d95 100644 --- a/client/cypress/integration/LegacyTests/latlngurl.spec.js +++ b/client/cypress/integration/LegacyTests/mapZoomLatLong.spec.js @@ -1,15 +1,15 @@ // / -describe('LatLng Test', () => { - it('URL starts at zoom level 3', () => { +describe('Does the map zoom and adjust to lat/long correctly?', () => { + it('should start at zoom level 3', () => { cy.visit('http://localhost:8000/en/cejst'); cy.url().should('include', '#3'); }); - it('URL changes to level 4 when you hit the zoom button', () => { - cy.get('.mapboxgl-ctrl-zoom-in > .mapboxgl-ctrl-icon').click(); + it('should change to level 4 when you hit the zoom button', () => { + cy.get('.mapboxgl-ctrl-icon.mapboxgl-ctrl-zoom-in').click(); cy.url().should('include', '#4'); }); - it('URL includes correct lat/lng coordinates', () => { + it('should show the correct lat/lng coordinates in the URL', () => { cy.getMap().then((map) => { cy.panTo(map, [-77.9, 35.04]); cy.url().should('include', '#4/35.04/-77.9'); diff --git a/client/cypress/integration/LegacyTests/map.spec.js b/client/cypress/integration/LegacyTests/mapZoomTerritories.spec.js similarity index 64% rename from client/cypress/integration/LegacyTests/map.spec.js rename to client/cypress/integration/LegacyTests/mapZoomTerritories.spec.js index 03176945..3f28146f 100644 --- a/client/cypress/integration/LegacyTests/map.spec.js +++ b/client/cypress/integration/LegacyTests/mapZoomTerritories.spec.js @@ -1,6 +1,6 @@ // / -describe('Tests for the Explore the Map page', () => { +describe('Will it zoom into territories correctly?', () => { beforeEach(() => { cy.viewport('macbook-13'); cy.visit('http://localhost:8000/en/cejst'); @@ -8,21 +8,24 @@ describe('Tests for the Explore the Map page', () => { // The below values all assume a 13-inch MB as set in viewport above. // Values will be different for different screens + + // Removing z as each tests has variance on it's value const tests = { - 'Lower 48': '3.19/38.07/-95.87', - 'Puerto Rico': '7.65/18.2/-66.583', + 'Lower 48': '/38.07/-95.87', + 'Puerto Rico': '/18.2/-66.583', // Todo: Understand what causes these two to hang intermittently ticket #579 - // 'Alaska': '3/63.28/-162.39', + // 'Alaska': '/63.28/-162.39', // 'Hawaii': '5.35/20.574/-161.438', }; - for (const [territory, zxy] of Object.entries(tests)) { + for (const [territory, xy] of Object.entries(tests)) { it(`Can focus on ${territory} `, () => { cy.getMap().then((map) => { cy.get(`[aria-label="Focus on ${territory}"]`).click(); cy.waitForMapIdle(map); - cy.url().should('include', zxy); + cy.log(cy.url()); + cy.url().should('include', xy); }); }); }; diff --git a/client/src/components/AboutCard/AboutCard.tsx b/client/src/components/AboutCard/AboutCard.tsx index bf126ff7..e7200c2e 100644 --- a/client/src/components/AboutCard/AboutCard.tsx +++ b/client/src/components/AboutCard/AboutCard.tsx @@ -31,7 +31,7 @@ const AboutCard = (props: React.PropsWithChildren) => { -

{props.header}

+

{props.header}

{props.children}
diff --git a/client/src/pages/__snapshots__/index.test.tsx.snap b/client/src/pages/__snapshots__/index.test.tsx.snap index 2d071c8a..ad881ee4 100644 --- a/client/src/pages/__snapshots__/index.test.tsx.snap +++ b/client/src/pages/__snapshots__/index.test.tsx.snap @@ -284,7 +284,9 @@ exports[`rendering of the DatasetContainer checks if various text fields are vis class="grid-container-desktop-lg" data-testid="gridContainer" > -

+

About us

-

+

The screening tool

@@ -363,9 +363,7 @@ exports[`rendering of the DatasetContainer checks if various text fields are vis class="grid-row" data-testid="grid" > -

+

The Justice40 Initiative

diff --git a/client/src/pages/index.tsx b/client/src/pages/index.tsx index a89f386d..09a0b1af 100644 --- a/client/src/pages/index.tsx +++ b/client/src/pages/index.tsx @@ -41,7 +41,7 @@ const IndexPage = ({location}: IndexPageProps) => { -

{intl.formatMessage(ABOUT_COPY.PAGE.HEADING)}

+

{intl.formatMessage(ABOUT_COPY.PAGE.HEADING)}