Skip to content

Commit

Permalink
Merge pull request #45 from DCFoundation/fix/failing-tests
Browse files Browse the repository at this point in the history
fix: failing tests
  • Loading branch information
0xpatrickdev authored Mar 7, 2024
2 parents c9491c4 + 654f050 commit 4e09220
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 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/DepositSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const DepositSection: React.FC<unknown> = () => {
className="block w-full rounded-md border-0 py-3 text-gray-900 shadow-sm ring-1 ring-inset ring-light placeholder:text-gray-400 focus:ring-1 focus:ring-inset focus:ring-red max-w-[250px]"
/>

<p className="mt-[10px] text-sm text-blue bg-white p-[20px] rounded-md">
<div className="mt-[10px] text-sm text-blue bg-white p-[20px] rounded-md">
<div className={`flex items-center border-b pb-3 mb-3`}>
<div className={`basis-auto pr-3`}>
<svg
Expand Down Expand Up @@ -139,7 +139,7 @@ export const DepositSection: React.FC<unknown> = () => {
</span>
</div>
</div>
</p>
</div>
</div>
</div>
);
Expand Down
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
13 changes: 5 additions & 8 deletions src/components/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,11 @@ const Nav = ({ title, showLogo, rightContent }: NavProps) => (
</div>
) : null}
<h1 className="text-white pr-3 py-2 font-semibold text-md">
<Link href="/">
<div
className={
"bg-teal-500 text-xs font-medium me-2 px-2.5 py-0.5 rounded text-white"
}
>
{title}
</div>
<Link
className="bg-teal-500 text-xs font-medium me-2 px-2.5 py-0.5 rounded text-white"
href="/"
>
{title}
</Link>
</h1>
</div>
Expand Down

0 comments on commit 4e09220

Please sign in to comment.