Skip to content

Commit

Permalink
fix: tests are broken
Browse files Browse the repository at this point in the history
  • Loading branch information
0xpatrickdev committed Mar 7, 2024
1 parent c9491c4 commit da358d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
19 changes: 9 additions & 10 deletions src/App.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "./installSesLockdown.js";
import { render, screen, within } from "@testing-library/react";
import { render, screen } from "@testing-library/react";
import App from "./App";
import { ContextProviders } from "./contexts/providers.tsx";

Expand Down Expand Up @@ -37,12 +37,10 @@ describe("App.tsx", () => {
</ContextProviders>,
);

const navElement = screen.getAllByRole("navigation")[0];
const selectElement = within(navElement).getByRole("button", {
name: "Select",
expanded: false,
const selectElements = screen.getAllByRole("button", {
name: "Select Chain",
});
expect(selectElement).toBeTruthy();
expect(selectElements.length).toBeGreaterThan(0);

describe.todo("selecting value puts chain in pathname");
describe.todo("changing value resets the network dropdown value");
Expand All @@ -55,12 +53,10 @@ describe("App.tsx", () => {
</ContextProviders>,
);

const navElement = screen.getAllByRole("navigation")[0];
const selectElement = within(navElement).getByRole("button", {
const selectElements = screen.getAllByRole("button", {
name: "Select Network",
expanded: false,
});
expect(selectElement).toBeTruthy();
expect(selectElements.length).toBeGreaterThan(0);
});

it("renders list of chains as tiles", async () => {
Expand All @@ -87,5 +83,8 @@ describe("App.tsx", () => {

const footerEl = await screen.findByRole("contentinfo");
expect(footerEl.querySelectorAll("a").length).toBe(3);

const sponsoredText = await screen.findByText("Sponsored by");
expect(sponsoredText).toBeTruthy();
});
});
4 changes: 2 additions & 2 deletions src/components/LayoutFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Footer } from "./Footer.tsx";

const LayoutFooter = () => {
return (
<div className={`layout-footer px-4 py-5`}>
<footer className={`layout-footer px-4 py-5`}>
<div className={"flex items-center justify-center"}>
<div className={"basis-full md:basis-auto md:hidden"}>
<Footer />
Expand Down Expand Up @@ -56,7 +56,7 @@ const LayoutFooter = () => {
</div>
</div>
</div>
</div>
</footer>
);
};

Expand Down

0 comments on commit da358d0

Please sign in to comment.