aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/components/HeaderBar.test.tsx
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2021-01-17 16:19:18 +0000
committerGravatar GitHub <[email protected]>2021-01-17 16:19:18 +0000
commitc1bee9cb0efba823740095380cfcca9bf47eb196 (patch)
tree18ed06bca3d17341e9eeabc5364023b9f3ee250b /src/tests/components/HeaderBar.test.tsx
parentMerge pull request #82 from python-discord/renovate/typescript-eslint-monorepo (diff)
parentCenters Title With No Description (diff)
Merge pull request #74 from python-discord/form-rendering
Diffstat (limited to 'src/tests/components/HeaderBar.test.tsx')
-rw-r--r--src/tests/components/HeaderBar.test.tsx23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/tests/components/HeaderBar.test.tsx b/src/tests/components/HeaderBar.test.tsx
index 9c232ad..dd77c8b 100644
--- a/src/tests/components/HeaderBar.test.tsx
+++ b/src/tests/components/HeaderBar.test.tsx
@@ -2,16 +2,35 @@ import React from "react";
import { render } from "@testing-library/react";
import "@testing-library/jest-dom/extend-expect";
import HeaderBar from "../../components/HeaderBar";
+import { MemoryRouter } from "react-router-dom";
test("renders header bar with title", () => {
- const { getByText } = render(<HeaderBar />);
+ const { getByText } = render(<MemoryRouter><HeaderBar /></MemoryRouter>);
const formListing = getByText(/Python Discord Forms/i);
expect(formListing).toBeInTheDocument();
});
test("renders header bar with custom title", () => {
- const { getByText } = render(<HeaderBar title="Testing title"/>);
+ const { getByText } = render(<MemoryRouter><HeaderBar title="Testing title"/></MemoryRouter>);
const formListing = getByText(/Testing title/i);
expect(formListing).toBeInTheDocument();
});
+test("renders header bar with custom description", () => {
+ const { getByText } = render(<MemoryRouter><HeaderBar description="Testing description"/></MemoryRouter>);
+ const formListing = getByText(/Testing description/i);
+ expect(formListing).toBeInTheDocument();
+});
+
+test("renders header bar with custom title and description", () => {
+ const { getByText } = render(
+ <MemoryRouter>
+ <HeaderBar title="Testing Title" description="Testing description"/>
+ </MemoryRouter>
+ );
+
+ const title = getByText(/Testing title/i);
+ const description = getByText(/Testing description/i);
+ expect(title).toBeInTheDocument();
+ expect(description).toBeInTheDocument();
+});