Skip to content

Commit

Permalink
Add a test for showing the theme image.
Browse files Browse the repository at this point in the history
  • Loading branch information
akademy committed Jan 8, 2025
1 parent 143a3e9 commit 24858a4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/Footer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import "@testing-library/jest-dom";
import dlsLogo from "../public/generic/logo-short.svg";
import { Footer, FooterLink, FooterLinks } from "./Footer";
import { ImageColorSchemeSwitch } from "./ImageColorSchemeSwitch";
import {ThemeProvider} from "../themes/ThemeProvider";

Check failure on line 7 in src/components/Footer.test.tsx

View workflow job for this annotation

GitHub Actions / build (22.12.0)

Replace `ThemeProvider` with `·ThemeProvider·`

jest.mock("./ImageColorSchemeSwitch");
// @ts-expect-error: doesn't find mockImplementation outside of testing.
Expand All @@ -17,6 +18,12 @@ describe("Footer", () => {
// No copyright text
expect(screen.queryByRole("paragraph")).not.toBeInTheDocument();
});

Check failure on line 21 in src/components/Footer.test.tsx

View workflow job for this annotation

GitHub Actions / build (22.12.0)

Delete `··`
test("Should render logo via theme", () => {
render(<ThemeProvider><Footer logo="theme" /></ThemeProvider>);

Check failure on line 23 in src/components/Footer.test.tsx

View workflow job for this annotation

GitHub Actions / build (22.12.0)

Replace `<ThemeProvider><Footer·logo="theme"·/></ThemeProvider>);` with `⏎······<ThemeProvider>⏎········<Footer·logo="theme"·/>⏎······</ThemeProvider>,`

Check failure on line 24 in src/components/Footer.test.tsx

View workflow job for this annotation

GitHub Actions / build (22.12.0)

Insert `);⏎`
expect(screen.getByRole("img")).toBeInTheDocument();
});

test("Should render copyright only", async () => {
const copyrightText = "add text here";
Expand Down

0 comments on commit 24858a4

Please sign in to comment.