Skip to content

Commit

Permalink
tests: pw test for footer component
Browse files Browse the repository at this point in the history
  • Loading branch information
MGeovany committed Mar 28, 2024
1 parent 2e3b6a7 commit 82a7174
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/layouts/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function Footer() {
return (
<footer className="bg-black7 h-32 flex justify-center items-center border-gray-900 border-t-2 z-10`">
<footer className="bg-black7 h-32 flex justify-center items-center border-gray-900 border-t-2 z-10">
<p className="mr-0 text-sm font-bold">
copyright &copy; 2024 <span className="text-green-500">zoro.cut</span>
</p>
Expand Down
19 changes: 19 additions & 0 deletions tests/e2e/footer.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { test, expect } from "@playwright/test";

test.describe("Footer Component", () => {
test("should render correctly with copyright information", async ({
page,
}) => {
await page.goto("./");

const footer = await page.waitForSelector("footer");

expect(await footer.isVisible()).toBeTruthy();

const footerText = await footer.textContent();

expect(footerText).toContain("copyright");
expect(footerText).toContain("2024");
expect(footerText).toContain("zoro.cut");
});
});

0 comments on commit 82a7174

Please sign in to comment.