From 202b569b0cf2183b62db0e542e22c25b419a5bf5 Mon Sep 17 00:00:00 2001 From: Ahmad Azizi <91204996+its-aazizi@users.noreply.github.com> Date: Mon, 12 Aug 2024 16:36:36 +0500 Subject: [PATCH 1/2] removed overview page link --- src/atomicui/organisms/Explore/Explore.tsx | 7 ---- src/atomicui/organisms/Sidebar/Sidebar.tsx | 4 +- src/core/constants/appConfig.ts | 1 - .../constants/marketingMenuOptionsData.ts | 10 ----- src/setupTests.ts | 42 ------------------- 5 files changed, 2 insertions(+), 62 deletions(-) diff --git a/src/atomicui/organisms/Explore/Explore.tsx b/src/atomicui/organisms/Explore/Explore.tsx index 34f05207..deb27318 100644 --- a/src/atomicui/organisms/Explore/Explore.tsx +++ b/src/atomicui/organisms/Explore/Explore.tsx @@ -53,7 +53,6 @@ const { PRICING_PAGE }, ROUTES: { - OVERVIEW, SAMPLES, MIGRATE_FROM_GOOGLE_MAPS, MIGRATE_A_WEB_APP, @@ -271,12 +270,6 @@ const Explore: FC = ({ const exploreMoreOptions = useMemo( () => [ - { - title: t("header__overview.text"), - description: t("settings_modal_option__overview.text"), - onClickHandler: () => navigate(OVERVIEW), - isEnabled: true - }, { title: t("samples.text"), description: t("settings_modal_option__samples.text"), diff --git a/src/atomicui/organisms/Sidebar/Sidebar.tsx b/src/atomicui/organisms/Sidebar/Sidebar.tsx index af412077..18cfa460 100644 --- a/src/atomicui/organisms/Sidebar/Sidebar.tsx +++ b/src/atomicui/organisms/Sidebar/Sidebar.tsx @@ -20,7 +20,7 @@ const List = lazy(() => import("@demo/atomicui/atoms/List").then(module => ({ de const Logo = lazy(() => import("@demo/atomicui/atoms/Logo").then(module => ({ default: module.Logo }))); const { - ROUTES: { DEMO, OVERVIEW } + ROUTES: { DEFAULT, DEMO } } = appConfig; interface SidebarProps { @@ -136,7 +136,7 @@ const Sidebar: FC = ({ padding: "16px 20px", cursor: "pointer" }} - onClick={() => navigate(OVERVIEW)} + onClick={() => navigate(DEFAULT)} /> diff --git a/src/core/constants/appConfig.ts b/src/core/constants/appConfig.ts index b045910f..e55fca79 100644 --- a/src/core/constants/appConfig.ts +++ b/src/core/constants/appConfig.ts @@ -92,7 +92,6 @@ const appConfig = { NL_DEMO: "/demo?dp=Esri&nl=true", NOT_FOUND: "/404", ERROR_BOUNDARY: "/error", - OVERVIEW: "/overview", SAMPLES: "/samples", SAMPLE_DETAILS: "/sample/:sampleId", HELP: "/demo/help", diff --git a/src/core/constants/marketingMenuOptionsData.ts b/src/core/constants/marketingMenuOptionsData.ts index 700af35d..2dc4e4c3 100644 --- a/src/core/constants/marketingMenuOptionsData.ts +++ b/src/core/constants/marketingMenuOptionsData.ts @@ -2,7 +2,6 @@ /* SPDX-License-Identifier: MIT-0 */ import IconCodeMenu from "@demo/assets/svgs/icon-code-menu-icon.svg"; -import IconCompassMenu from "@demo/assets/svgs/icon-compass-menu-icon.svg"; import IconDollarSolid from "@demo/assets/svgs/icon-dollar-solid.svg"; import IconSwap from "@demo/assets/svgs/icon-swap.svg"; @@ -18,7 +17,6 @@ const { PRICING_PAGE }, ROUTES: { - OVERVIEW, SAMPLES, MIGRATE_FROM_GOOGLE_MAPS, MIGRATE_A_WEB_APP, @@ -39,7 +37,6 @@ type MenuItem = { }; const routeToEnvMapping = { - [OVERVIEW]: "1", [SAMPLES]: "1", [MIGRATE_FROM_GOOGLE_MAPS]: MIGRATE_FROM_GOOGLE_MAPS_PAGE, [MIGRATE_A_WEB_APP]: MIGRATE_A_WEB_APP_PAGE, @@ -52,13 +49,6 @@ const routeToEnvMapping = { const shouldIncludeMenuItem = (menuItem: MenuItem) => !!parseInt(routeToEnvMapping[menuItem?.link]); let marketingMenuOptionsData: MenuItem[] = [ - { - label: "header__overview.text", - link: OVERVIEW, - iconBeforeLink: IconCompassMenu, - iconContainerClass: "menu-item-icon", - isExternalLink: false - }, { label: "samples.text", link: SAMPLES, diff --git a/src/setupTests.ts b/src/setupTests.ts index 76b66f70..3ddb92d9 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -69,7 +69,6 @@ jest.mock("@demo/core/constants/appConfig", () => ({ NL_DEMO: "/demo?dp=Esri&nl=true", NOT_FOUND: "/404", ERROR_BOUNDARY: "/error", - OVERVIEW: "/overview", SAMPLES: "/samples", SAMPLE_DETAILS: "/sample/:sampleId", HELP: "/demo/help", @@ -101,47 +100,6 @@ jest.mock("@demo/core/constants/appConfig", () => ({ [-123.061047, 49.303531] // northeast corner ] }, - // MAP_ITEMS: { - // [EsriMapEnum.ESRI_DARK_GRAY_CANVAS]: { - // style: EsriMapStyleEnum[EsriMapEnum.ESRI_DARK_GRAY_CANVAS] - // }, - // [EsriMapEnum.ESRI_IMAGERY]: { - // style: EsriMapStyleEnum[EsriMapEnum.ESRI_IMAGERY] - // }, - // [EsriMapEnum.ESRI_LIGHT]: { - // style: EsriMapStyleEnum[EsriMapEnum.ESRI_LIGHT] - // }, - // [EsriMapEnum.ESRI_LIGHT_GRAY_CANVAS]: { - // style: EsriMapStyleEnum[EsriMapEnum.ESRI_LIGHT_GRAY_CANVAS] - // }, - // [EsriMapEnum.ESRI_NAVIGATION]: { - // style: EsriMapStyleEnum[EsriMapEnum.ESRI_NAVIGATION] - // }, - // [EsriMapEnum.ESRI_STREET_MAP]: { - // style: EsriMapStyleEnum[EsriMapEnum.ESRI_STREET_MAP] - // }, - // [HereMapEnum.HERE_EXPLORE]: { - // style: HereMapStyleEnum[HereMapEnum.HERE_EXPLORE] - // }, - // [HereMapEnum.HERE_CONTRAST]: { - // style: HereMapStyleEnum[HereMapEnum.HERE_CONTRAST] - // }, - // [HereMapEnum.HERE_EXPLORE_TRUCK]: { - // style: HereMapStyleEnum[HereMapEnum.HERE_EXPLORE_TRUCK] - // }, - // [HereMapEnum.HERE_HYBRID]: { - // style: HereMapStyleEnum[HereMapEnum.HERE_HYBRID] - // }, - // [HereMapEnum.HERE_IMAGERY]: { - // style: HereMapStyleEnum[HereMapEnum.HERE_IMAGERY] - // }, - // [GrabMapEnum.GRAB_STANDARD_LIGHT]: { - // style: GrabMapStyleEnum[GrabMapEnum.GRAB_STANDARD_LIGHT] - // }, - // [GrabMapEnum.GRAB_STANDARD_DARK]: { - // style: GrabMapStyleEnum[GrabMapEnum.GRAB_STANDARD_DARK] - // } - // }, MAP_STYLES: { ESRI_STYLES: [ { id: "location.aws.com.demo.maps.Esri.Light", image: "", name: "Light" }, From c4f2b91e21ae4af42a31829eb80b4b171afc25ca Mon Sep 17 00:00:00 2001 From: Ahmad Azizi <91204996+its-aazizi@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:32:33 +0500 Subject: [PATCH 2/2] updated e2e test --- cypress/e2e/userIsAbleToUseTheSidebar.cy.js | 49 +++++++++++---------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/cypress/e2e/userIsAbleToUseTheSidebar.cy.js b/cypress/e2e/userIsAbleToUseTheSidebar.cy.js index eba24d4a..a1666308 100644 --- a/cypress/e2e/userIsAbleToUseTheSidebar.cy.js +++ b/cypress/e2e/userIsAbleToUseTheSidebar.cy.js @@ -6,31 +6,34 @@ describe("Sidebar", () => { it("SB-001 - should allow user to access the sidebar via hamburger menu", { scrollBehavior: false }, () => { cy.visitDomain(`${Cypress.env("WEB_DOMAIN")}/demo`); cy.get('[data-testid="hamburger-menu"]').click(); - cy.get("div").should("contain", "Demo") - .and("contain", "Geofence") - .and("contain", "Tracker") - .and("contain", "Settings") - .and("contain", "Overview") - .and("contain", "Samples"); - }); + cy.get("div") + .should("contain", "Demo") + .and("contain", "Geofence") + .and("contain", "Tracker") + .and("contain", "Settings") + .and("contain", "Samples"); + }); }); context("Responsive view", () => { - it("SB-002 - should allow user to access the Bottom Sheet (sidebar) in responsive menu", { scrollBehavior: false }, () => { - cy.visitDomainInResponsiveView(`${Cypress.env("WEB_DOMAIN")}/demo`); - cy.openResponsiveMenu('[data-testid="bottomsheet"]'); - cy.get('[data-testid="explore-button-container-Map style"]').should("contain", "Map style"); - cy.get('[data-testid="explore-button-container-Routes"]').should("contain", "Routes"); - cy.get('[data-testid="explore-button-container-Geofences"]').should("contain", "Geofences"); - cy.get('[data-testid="explore-button-container-Trackers"]').should("contain", "Tracker"); - cy.get('[data-testid="iconic-info-card-title"]') - .should("contain", "Overview") - .and("contain", "Samples") - .and("contain", "Migration") - .and("contain", "Pricing") - .and("contain", "Settings") - .and("contain", "About") - .and("contain", "Provide Feedback") - }); + it( + "SB-002 - should allow user to access the Bottom Sheet (sidebar) in responsive menu", + { scrollBehavior: false }, + () => { + cy.visitDomainInResponsiveView(`${Cypress.env("WEB_DOMAIN")}/demo`); + cy.openResponsiveMenu('[data-testid="bottomsheet"]'); + cy.get('[data-testid="explore-button-container-Map style"]').should("contain", "Map style"); + cy.get('[data-testid="explore-button-container-Routes"]').should("contain", "Routes"); + cy.get('[data-testid="explore-button-container-Geofences"]').should("contain", "Geofences"); + cy.get('[data-testid="explore-button-container-Trackers"]').should("contain", "Tracker"); + cy.get('[data-testid="iconic-info-card-title"]') + .should("contain", "Samples") + .and("contain", "Migration") + .and("contain", "Pricing") + .and("contain", "Settings") + .and("contain", "About") + .and("contain", "Provide Feedback"); + } + ); }); });