From ba7ae0ebcfdcffb8415474a7cae8946e0be5f6e9 Mon Sep 17 00:00:00 2001 From: Aaron Couch Date: Wed, 15 May 2024 18:13:35 -0400 Subject: [PATCH] Update tests --- frontend/src/app/process/page.tsx | 20 ++++++++++++------- .../content/ProcessIntro.tsx | 0 .../content/ProcessInvolved.tsx | 0 .../content/ProcessMilestones.tsx | 0 .../components/ProcessContent.stories.tsx | 2 +- .../tests/components/ProcessIntro.test.tsx | 2 +- .../tests/components/ProcessInvolved.test.tsx | 2 +- .../components/ProcessMilestones.test.tsx | 2 +- frontend/tests/pages/process.test.tsx | 4 +++- 9 files changed, 20 insertions(+), 12 deletions(-) rename frontend/src/{pages => components}/content/ProcessIntro.tsx (100%) rename frontend/src/{pages => components}/content/ProcessInvolved.tsx (100%) rename frontend/src/{pages => components}/content/ProcessMilestones.tsx (100%) diff --git a/frontend/src/app/process/page.tsx b/frontend/src/app/process/page.tsx index d5e606a78b..d2bbebb81d 100644 --- a/frontend/src/app/process/page.tsx +++ b/frontend/src/app/process/page.tsx @@ -5,22 +5,28 @@ import BetaAlert from "src/components/AppBetaAlert"; import Breadcrumbs from "src/components/Breadcrumbs"; import PageSEO from "src/components/PageSEO"; import { Metadata } from "next"; -import ProcessIntro from "src/pages/content/ProcessIntro"; -import ProcessInvolved from "src/pages/content/ProcessInvolved"; -import ProcessMilestones from "src/pages/content/ProcessMilestones"; -import { getTranslations } from "next-intl/server"; +import ProcessIntro from "src/components/content/ProcessIntro"; +import ProcessInvolved from "src/components/content/ProcessInvolved"; +import ProcessMilestones from "src/components/content/ProcessMilestones"; import { useTranslations } from "next-intl"; +import { unstable_setRequestLocale } from "next-intl/server"; -export async function generateMetadata() { - const t = await getTranslations({ locale: "en" }); +export function generateMetadata() { + // TODO: Enable once [locale] folder created, see: https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing + // const t = await getTranslations({ locale: "en" }); const meta: Metadata = { - title: t("Process.page_title"), + // title: t("Process.page_title"), + title: "Process | Simpler.Grants.gov", + description: + "A oneā€‘stop shop for all federal discretionary funding to make it easy for you to discover, understand, and apply for opportunities.", }; return meta; } export default function Process() { + // TODO: Remove when https://github.com/amannn/next-intl/issues/663 lands. + unstable_setRequestLocale("en"); const t = useTranslations("Process"); return ( diff --git a/frontend/src/pages/content/ProcessIntro.tsx b/frontend/src/components/content/ProcessIntro.tsx similarity index 100% rename from frontend/src/pages/content/ProcessIntro.tsx rename to frontend/src/components/content/ProcessIntro.tsx diff --git a/frontend/src/pages/content/ProcessInvolved.tsx b/frontend/src/components/content/ProcessInvolved.tsx similarity index 100% rename from frontend/src/pages/content/ProcessInvolved.tsx rename to frontend/src/components/content/ProcessInvolved.tsx diff --git a/frontend/src/pages/content/ProcessMilestones.tsx b/frontend/src/components/content/ProcessMilestones.tsx similarity index 100% rename from frontend/src/pages/content/ProcessMilestones.tsx rename to frontend/src/components/content/ProcessMilestones.tsx diff --git a/frontend/stories/components/ProcessContent.stories.tsx b/frontend/stories/components/ProcessContent.stories.tsx index 736eea64b6..50284590f7 100644 --- a/frontend/stories/components/ProcessContent.stories.tsx +++ b/frontend/stories/components/ProcessContent.stories.tsx @@ -1,5 +1,5 @@ import { Meta } from "@storybook/react"; -import ProcessContent from "src/pages/content/ProcessIntro"; +import ProcessContent from "src/components/content/ProcessIntro"; const meta: Meta = { title: "Components/Content/Process Content", diff --git a/frontend/tests/components/ProcessIntro.test.tsx b/frontend/tests/components/ProcessIntro.test.tsx index fcbba0b378..c557dfd520 100644 --- a/frontend/tests/components/ProcessIntro.test.tsx +++ b/frontend/tests/components/ProcessIntro.test.tsx @@ -1,5 +1,5 @@ import { render, screen } from "tests/react-utils"; -import ProcessIntro from "src/pages/content/ProcessIntro"; +import ProcessIntro from "src/components/content/ProcessIntro"; describe("Process Content", () => { it("Renders without errors", () => { diff --git a/frontend/tests/components/ProcessInvolved.test.tsx b/frontend/tests/components/ProcessInvolved.test.tsx index 75f70224d0..9ac8744262 100644 --- a/frontend/tests/components/ProcessInvolved.test.tsx +++ b/frontend/tests/components/ProcessInvolved.test.tsx @@ -1,5 +1,5 @@ import { render, screen } from "tests/react-utils"; -import ProcessInvolved from "src/pages/content/ProcessInvolved"; +import ProcessInvolved from "src/components/content/ProcessInvolved"; describe("Process Content", () => { it("Renders without errors", () => { diff --git a/frontend/tests/components/ProcessMilestones.test.tsx b/frontend/tests/components/ProcessMilestones.test.tsx index 1973c93f29..1d322533c1 100644 --- a/frontend/tests/components/ProcessMilestones.test.tsx +++ b/frontend/tests/components/ProcessMilestones.test.tsx @@ -1,5 +1,5 @@ import { render, screen } from "tests/react-utils"; -import ProcessMilestones from "src/pages/content/ProcessMilestones"; +import ProcessMilestones from "src/components/content/ProcessMilestones"; describe("Process Content", () => { it("Renders without errors", () => { diff --git a/frontend/tests/pages/process.test.tsx b/frontend/tests/pages/process.test.tsx index 7ab22ecf9d..93e4ab2f4e 100644 --- a/frontend/tests/pages/process.test.tsx +++ b/frontend/tests/pages/process.test.tsx @@ -1,4 +1,6 @@ -import { render, screen, waitFor } from "tests/react-utils"; +import { screen, waitFor } from "tests/react-utils"; +import { render } from "@testing-library/react"; + import { axe } from "jest-axe"; import Process from "src/app/process/page";