Re-order nav links, update download box to include shapefiles, squish pages (#1538)

* Re-order nav links, update download box to include shapefiles, squishy pages (#1536)

* Add dropdown to navigation links

- add download page
- move main pages tests to their own folder
- add download and public eng snapshot test
- remove public engagement button on each page
- swap index with cejst
- update cypress ENDPOINTS
- upate gatsby-config sitemap
- update snapshots
- cypress tests are failing

* Make all page endpoints constants

- fix all cypress tests
- refactor all test to use LegacyTests/constants/PAGES_ENDPOINTS
- gatsby-config to use PAGES_ENDPOINTS
- remove ScoreStepList component
- update J40Header to use constants.PAGES_ENDPOINTS
- update snapshots
- there are 3 locations to update PAGES_ENDPOINTS, namely

1. LegacyTests/constants.tsx
2. constants.tsx
3. gatsby-config

* Add two placeholder pages

- FAQs
- TSD

* remove dropdown from navigation menu

- remove dropdown from gherkin tests
- update snapshots

* Add back public engagement button to all pages

- add send button in area detail alt tag to i18n
- modify public engagement button to have same CSS as send feedback button
- update snapshots

* Update download box to include shapefile downloads

- refator download packet scss
- add shapefile URL to .env files
- update tests
- index forwarding pattern
- update snapshots

* Add FAQ link to About page

* Update footer

- add PEC
- add RFI
- add github link

* Update the staging link URL and title

* Update download Box to match design sync

- update FAQ link copy

* Add comment for reason of commented code
This commit is contained in:
Vim 2022-04-07 13:14:54 -04:00 committed by GitHub
commit 92501e4715
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
71 changed files with 4400 additions and 605 deletions

View file

@ -12,14 +12,11 @@
*
*/
const endpoints = [
'en/',
'en/cejst',
'en/methodology',
'en/contact',
'en/404',
'en/public-engagement',
];
import {PAGES_ENDPOINTS} from './constants';
const rawEndpoints = Object.values(PAGES_ENDPOINTS);
const endpoints = rawEndpoints.map((endpoint) => `en${endpoint}`);
// The violation callback will post the violations into the terminal
// eslint-disable-next-line require-jsdoc

View file

@ -1,13 +1,9 @@
// / <reference types="Cypress" />
import {PAGES_ENDPOINTS} from '../LegacyTests/constants';
describe('Do all the English pages have all links with a defined href attribute?', () => {
const pages = [
'/',
'cejst',
'methodology',
'contact',
'public-engagement',
];
const pages = Object.values(PAGES_ENDPOINTS);
pages.forEach((page) => {
it(`test all href attr on ${page} page`, () => {

View file

@ -1,7 +1,10 @@
export const ENDPOINTS = {
ABOUT: 'en/',
EXPLORE_THE_TOOL: '/en/cejst',
METHODOLOGY: '/en/methodology',
CONTACT: 'en/contact',
PUBLIC: 'en/public-engagement',
export const PAGES_ENDPOINTS = {
EXPLORE: '/',
METHODOLOGY: '/methodology',
DOWNLOADS: '/downloads',
TSD: '/technical-support-document',
ABOUT: '/about',
FAQS: '/frequently-asked-questions',
PUBLIC_ENG: '/public-engagement',
CONTACT: '/contact',
};

View file

@ -1,23 +1,23 @@
// / <reference types="Cypress" />
describe('Does the Census Block Group packet download?', () => {
const filename = `Screening_Tool_Data.zip`;
it('validate file download', () => {
cy.visit('localhost:8000/en/methodology');
// 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('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',
'Content-Disposition': 'attachment',
},
},
).as('downloadRequest');
cy.get('button[class*="downloadPacket"]').click();
cy.wait('@downloadRequest');
cy.readFile(`cypress/downloads/${filename}`).should('exist');
});
});
// cy.get('[data-cy="download-link"]').invoke('attr', 'target', '_blank').invoke('attr', 'download');
// 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',
// 'Content-Disposition': 'attachment',
// },
// },
// ).as('downloadRequest');
// cy.get('button[class*="downloadPacket"]').click();
// cy.wait('@downloadRequest');
// cy.readFile(`cypress/downloads/${filename}`).should('exist');
// });
// });

View file

@ -1,11 +1,14 @@
// / <reference types="Cypress" />
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-page-heading]').contains('About');
});
import {PAGES_ENDPOINTS} from './constants';
describe('Navigate to each endpoint', () => {
Object.values(PAGES_ENDPOINTS).map((endpoint) =>
it(`for the ${endpoint} page, it adds /en and redirects`, () => {
cy.visit(endpoint);
cy.url().should('include', '/en/');
}),
);
// Todo VS: Understand how to create es content
// it('Sets page content to spanish when visiting Spanish URL', () => {

View file

@ -4,7 +4,7 @@
A risk with this test is that if the feature/area that is currently being selected become non-prioritized, then this
test will fail. However it would be a major win for that area!
*/
import {ENDPOINTS} from './constants';
import {PAGES_ENDPOINTS} from './constants';
const devices = [
[1024, 720],
@ -15,7 +15,7 @@ const devices = [
describe('tests that the map side panel renders MapIntroduction component', () => {
devices.forEach((device) => {
it(`should render MapIntroduction component on ${device[0]} x ${device[1]}`, () => {
cy.visit(ENDPOINTS.EXPLORE_THE_TOOL);
cy.visit(PAGES_ENDPOINTS.EXPLORE);
cy.viewport(device[0], device[1]);
cy.get('aside').should('be.visible');
});

View file

@ -1,8 +1,9 @@
// / <reference types="Cypress" />
import {PAGES_ENDPOINTS} from '../LegacyTests/constants';
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.visit(PAGES_ENDPOINTS.EXPLORE);
cy.url().should('include', '#3');
});
it('should change to level 4 when you hit the zoom button', () => {
@ -10,7 +11,7 @@ describe('Does the map zoom and adjust to lat/long correctly?', () => {
cy.url().should('include', '#4');
});
// Intermittent failure still exist
// Intermittent failure still exist ticket #886
// it('should show the correct lat/lng coordinates in the URL',
// {
// retries: {
@ -47,6 +48,7 @@ describe('Does the map zoom and adjust to lat/long correctly?', () => {
// },
// () => {
// const [expectedZoom, expectedLat, expectedLng] = [12.05, 41.40965, -75.65978];
// //This could be where the issue is:
// const expectedURL = `http://localhost:8000/en/cejst/#${expectedZoom}/${expectedLat}/${expectedLng}`;
// cy.visit(expectedURL);
// cy.getMap().then((map) => {

View file

@ -1,5 +1,7 @@
// / <reference types="Cypress" />
import {PAGES_ENDPOINTS} from './constants';
describe('Will it zoom into territories correctly?',
{
retries: {
@ -16,7 +18,7 @@ describe('Will it zoom into territories correctly?',
() => {
beforeEach(() => {
cy.viewport('macbook-13');
cy.visit('http://localhost:8000/en/cejst');
cy.visit(PAGES_ENDPOINTS.EXPLORE);
});
// The below values all assume a 13-inch MB as set in viewport above.