-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #609 from CBIIT/CRDCDH-2269
CRDCDH-2269 Refactor Footer Components, Replace Newsletter Topic
- Loading branch information
Showing
10 changed files
with
640 additions
and
442 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { render } from "@testing-library/react"; | ||
import { BrowserRouter } from "react-router-dom"; | ||
import { axe } from "jest-axe"; | ||
import FooterDesktop from "./FooterDesktop"; | ||
|
||
describe("Accessibility", () => { | ||
it("should not have any accessibility violations", async () => { | ||
const { container } = render(<FooterDesktop />, { wrapper: (p) => <BrowserRouter {...p} /> }); | ||
|
||
expect(await axe(container)).toHaveNoViolations(); | ||
}); | ||
}); | ||
|
||
describe("Basic Functionality", () => { | ||
it("should render without crashing", () => { | ||
expect(() => | ||
render(<FooterDesktop />, { wrapper: (p) => <BrowserRouter {...p} /> }) | ||
).not.toThrow(); | ||
}); | ||
}); |
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,37 @@ | ||
import { render, within } from "@testing-library/react"; | ||
import { BrowserRouter } from "react-router-dom"; | ||
import { axe } from "jest-axe"; | ||
import userEvent from "@testing-library/user-event"; | ||
import FooterMobile from "./FooterMobile"; | ||
|
||
describe("Accessibility", () => { | ||
it("should not have any accessibility violations", async () => { | ||
const { container } = render(<FooterMobile />, { wrapper: (p) => <BrowserRouter {...p} /> }); | ||
|
||
expect(await axe(container)).toHaveNoViolations(); | ||
}); | ||
}); | ||
|
||
describe("Basic Functionality", () => { | ||
it("should render without crashing", () => { | ||
expect(() => | ||
render(<FooterMobile />, { wrapper: (p) => <BrowserRouter {...p} /> }) | ||
).not.toThrow(); | ||
}); | ||
|
||
it("should toggle the expand of sections on click", () => { | ||
const { getAllByTestId } = render(<FooterMobile />, { | ||
wrapper: (p) => <BrowserRouter {...p} />, | ||
}); | ||
|
||
const allGroups = getAllByTestId("dropdown-section-group"); | ||
|
||
userEvent.click(within(allGroups[0]).getByRole("button")); | ||
|
||
expect(within(allGroups[0]).getByTestId("dropdown-section-content")).toBeVisible(); | ||
|
||
userEvent.click(within(allGroups[0]).getByRole("button")); | ||
|
||
expect(within(allGroups[0]).getByTestId("dropdown-section-content")).not.toBeVisible(); | ||
}); | ||
}); |
Oops, something went wrong.