From 531978b5d599ba2bf2e135bd035d28e43319bca8 Mon Sep 17 00:00:00 2001 From: Vim USDS Date: Tue, 5 Apr 2022 13:17:38 -0700 Subject: [PATCH] remove dropdown from navigation menu - remove dropdown from gherkin tests - update snapshots --- client/cypress/integration/About.feature | 6 +- .../cypress/integration/Methodology.feature | 6 +- client/src/components/J40Header/J40Header.tsx | 200 ++++++++++-------- .../__snapshots__/J40Header.test.tsx.snap | 104 +-------- .../tests/__snapshots__/about.test.tsx.snap | 104 +-------- .../tests/__snapshots__/contact.test.tsx.snap | 104 +-------- .../__snapshots__/downloads.test.tsx.snap | 104 +-------- .../freqAskedQuestions.test.tsx.snap | 104 +-------- .../__snapshots__/methodology.test.tsx.snap | 104 +-------- .../__snapshots__/publicEng.test.tsx.snap | 104 +-------- .../techSupportDoc.test.tsx.snap | 104 +-------- 11 files changed, 194 insertions(+), 850 deletions(-) diff --git a/client/cypress/integration/About.feature b/client/cypress/integration/About.feature index 42d8f2a2..cc4063b0 100644 --- a/client/cypress/integration/About.feature +++ b/client/cypress/integration/About.feature @@ -2,18 +2,18 @@ Feature: The About page will open from all other pages Scenario: About page open when navigating from Methodology page Given I am on the "Methodology" page - When I click on the "About" dropdown in the navigation + # When I click on the "About" dropdown in the navigation When I click on the "About" page in the navigation Then I see "About" in the title Scenario: About page open when navigating from Explore the Tool page Given I am on the "Explore" page - When I click on the "About" dropdown in the navigation + # When I click on the "About" dropdown in the navigation When I click on the "About" page in the navigation Then I see "About" in the title Scenario: About page open when navigating from Contact page Given I am on the "Contact" page - When I click on the "About" dropdown in the navigation + # When I click on the "About" dropdown in the navigation When I click on the "About" page in the navigation Then I see "About" in the title diff --git a/client/cypress/integration/Methodology.feature b/client/cypress/integration/Methodology.feature index ff314289..973ac151 100644 --- a/client/cypress/integration/Methodology.feature +++ b/client/cypress/integration/Methodology.feature @@ -2,18 +2,18 @@ Feature: The Methodology page will open from all other pages Scenario: Methodology page open when navigating from About page Given I am on the "About" page - When I click on the "Methodology" dropdown in the navigation + # When I click on the "Methodology" dropdown in the navigation When I click on the "Methodology" page in the navigation Then I see "Methodology" in the title Scenario: Methodology page open when navigating from Explore the tool page Given I am on the "Explore" page - When I click on the "Methodology" dropdown in the navigation + # When I click on the "Methodology" dropdown in the navigation When I click on the "Methodology" page in the navigation Then I see "Methodology" in the title Scenario: Methodology page open when navigating from Contact page Given I am on the "Contact" page - When I click on the "Methodology" dropdown in the navigation + # When I click on the "Methodology" dropdown in the navigation When I click on the "Methodology" page in the navigation Then I see "Methodology" in the title \ No newline at end of file diff --git a/client/src/components/J40Header/J40Header.tsx b/client/src/components/J40Header/J40Header.tsx index 3e3e573b..232e8eeb 100644 --- a/client/src/components/J40Header/J40Header.tsx +++ b/client/src/components/J40Header/J40Header.tsx @@ -6,8 +6,8 @@ import { PrimaryNav, Grid, Alert, - NavDropDownButton, - Menu, + // NavDropDownButton, + // Menu, } from '@trussworks/react-uswds'; import BetaBanner from '../BetaBanner'; import J40MainGridContainer from '../J40MainGridContainer'; @@ -42,62 +42,63 @@ const J40Header = () => { * index 0 = Data & Methodology dropdown * index 1 = About dropdown */ - const [isOpen, setIsOpen] = useState([false, false]); - const onToggle = (index: number): void => { - setIsOpen((prevIsOpen) => { - const newIsOpen = [false, false]; - newIsOpen[index] = !prevIsOpen[index]; - return newIsOpen; - }); - }; + // const [isOpen, setIsOpen] = useState([false, false]); + // const onToggle = (index: number): void => { + // setIsOpen((prevIsOpen) => { + // const newIsOpen = [false, false]; + // newIsOpen[index] = !prevIsOpen[index]; + // return newIsOpen; + // }); + // }; - const methPageSubNavLinks = [ - - {intl.formatMessage(COMMON_COPY.HEADER.METHODOLOGY)} - , - - {intl.formatMessage(COMMON_COPY.HEADER.DOWNLOADS)} - , - - {intl.formatMessage(COMMON_COPY.HEADER.TSD)} - , - ]; + // Commenting out subnav links for now + // const methPageSubNavLinks = [ + // + // {intl.formatMessage(COMMON_COPY.HEADER.METHODOLOGY)} + // , + // + // {intl.formatMessage(COMMON_COPY.HEADER.DOWNLOADS)} + // , + // + // {intl.formatMessage(COMMON_COPY.HEADER.TSD)} + // , + // ]; - const aboutSubNavLinks = [ - - {intl.formatMessage(COMMON_COPY.HEADER.ABOUT)} - , - - {intl.formatMessage(COMMON_COPY.HEADER.FAQs)} - , - - {intl.formatMessage(COMMON_COPY.HEADER.PUBLIC_ENG)} - , - ]; + // const aboutSubNavLinks = [ + // + // {intl.formatMessage(COMMON_COPY.HEADER.ABOUT)} + // , + // + // {intl.formatMessage(COMMON_COPY.HEADER.FAQs)} + // , + // + // {intl.formatMessage(COMMON_COPY.HEADER.PUBLIC_ENG)} + // , + // ]; const navLinks = [ { data-cy={'nav-link-explore-the-tool'}> {intl.formatMessage(COMMON_COPY.HEADER.EXPLORE)} , - <> - onToggle(0)} - data-cy={'nav-dropdown-methodology'} - > - - - - , - <> - onToggle(1)} - data-cy={'nav-dropdown-about'} - > - - - - , + + {intl.formatMessage(COMMON_COPY.HEADER.METHODOLOGY)} + , + + {intl.formatMessage(COMMON_COPY.HEADER.ABOUT)} + , + // <> + // onToggle(0)} + // data-cy={'nav-dropdown-methodology'} + // className={styles.navDropDownBtn} + // > + // + // + // + // , + // <> + // onToggle(1)} + // data-cy={'nav-dropdown-about'} + // > + // + // + // + // , - - + Methodology & data +
  • - - + About +
  • - - + Methodology & data +
  • - - + About +
  • - - + Methodology & data +
  • - - + About +
  • - - + Methodology & data +
  • - - + About +
  • - - + Methodology & data +
  • - - + About +
  • - - + Methodology & data +
  • - - + About +
  • - - + Methodology & data +
  • - - + About +
  • - - + Methodology & data +
  • - - + About +