-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
964a135
commit 6bca9d9
Showing
5 changed files
with
87 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import RoadmapHeader from "src/app/[locale]/roadmap/RoadmapHeader"; | ||
import { render, screen } from "tests/react-utils"; | ||
|
||
describe("RoadmapHeader Content", () => { | ||
it("Renders with expected header", () => { | ||
render(<RoadmapHeader />); | ||
const RoadmapH1 = screen.getByRole("heading", { | ||
level: 1, | ||
name: /Product roadmap?/i, | ||
}); | ||
|
||
expect(RoadmapH1).toBeInTheDocument(); | ||
}); | ||
}); |
14 changes: 14 additions & 0 deletions
14
frontend/tests/components/roadmap/RoadmapMilestones.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import RoadmapMilestones from "src/app/[locale]/roadmap/RoadmapMilestones"; | ||
import { render, screen } from "tests/react-utils"; | ||
|
||
describe("RoadmapMilestones Content", () => { | ||
it("Renders with expected header", () => { | ||
render(<RoadmapMilestones />); | ||
const RoadmapMilestonesH2 = screen.getByRole("heading", { | ||
level: 2, | ||
name: /Recent milestones reached?/i, | ||
}); | ||
|
||
expect(RoadmapMilestonesH2).toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { render, screen, waitFor } from "@testing-library/react"; | ||
import { axe } from "jest-axe"; | ||
import { identity } from "lodash"; | ||
import Roadmap from "src/app/[locale]/roadmap/page"; | ||
import { mockMessages, useTranslationsMock } from "src/utils/testing/intlMocks"; | ||
|
||
jest.mock("react", () => ({ | ||
...jest.requireActual<typeof import("react")>("react"), | ||
use: jest.fn(() => ({ | ||
locale: "en", | ||
})), | ||
})); | ||
|
||
jest.mock("next-intl/server", () => ({ | ||
getTranslations: () => identity, | ||
setRequestLocale: identity, | ||
})); | ||
|
||
jest.mock("next-intl", () => ({ | ||
useTranslations: () => useTranslationsMock(), | ||
useMessages: () => mockMessages, | ||
})); | ||
|
||
describe("Roadmap", () => { | ||
it("renders header title text", () => { | ||
render(<Roadmap />); | ||
const content = screen.getByText("pageHeaderTitle"); | ||
expect(content).toBeInTheDocument(); | ||
}); | ||
|
||
it("passes accessibility scan", async () => { | ||
const { container } = render(<Roadmap />); | ||
const results = await waitFor(() => axe(container)); | ||
expect(results).toHaveNoViolations(); | ||
}); | ||
}); |