Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/routes/delete-account/DeleteAccount.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ describe("DeleteAccount", () => {
test("renders page title and account deletion steps", () => {
setup();
expect(
screen.getByRole("heading", {
level: 1,
name: /delete your account/i,
}),
screen.getByRole("heading", { name: /delete your account/i, level: 1 }),
).toBeInTheDocument();
expect(screen.getByText(/open the webuddhist app/i)).toBeInTheDocument();
expect(screen.getByText(/go to profile/i)).toBeInTheDocument();
Expand Down
13 changes: 11 additions & 2 deletions src/routes/footer/Footer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,21 @@ describe("Footer", () => {
test("renders correct total number of links", () => {
setup();
const links = screen.getAllByRole("link");
// +1 for the Privacy Policy internal link
// +2 for the Privacy Policy and Terms of Service internal links
expect(links).toHaveLength(
expectedColumnLinks.length + expectedSocialLinks.length + 1,
expectedColumnLinks.length + expectedSocialLinks.length + 2,
);
});

test("renders Privacy Policy and Terms of Service footer links", () => {
setup();
const privacyLink = screen.getByRole("link", { name: /privacy policy/i });
expect(privacyLink).toHaveAttribute("href", "/privacy-policy");

const tosLink = screen.getByRole("link", { name: /terms of service/i });
expect(tosLink).toHaveAttribute("href", "/terms-of-service");
});

test("uses translation helper for column headings", () => {
setup();

Expand Down
23 changes: 16 additions & 7 deletions src/routes/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,22 @@ const Footer = () => {
© {new Date().getFullYear()} WeBuddhist · OpenPecha Trust. All
rights reserved.
</p>
<Link
to="/privacy-policy"
className="text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2"
aria-label="Privacy Policy"
>
Privacy Policy
</Link>
<div className="flex items-center gap-4">
<Link
to="/privacy-policy"
className="text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2"
aria-label="Privacy Policy"
>
Privacy Policy
</Link>
<Link
to="/terms-of-service"
className="text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2"
aria-label="Terms of Service"
>
Terms of Service
</Link>
</div>
</div>
</footer>
);
Expand Down
51 changes: 51 additions & 0 deletions src/routes/terms-of-service/TermsOfService.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { render, screen } from "@testing-library/react";
import "@testing-library/jest-dom";
import { MemoryRouter } from "react-router-dom";
import { describe, expect, test } from "vitest";
import "../../test-utils/CommonMocks.ts";

import TermsOfService from "./TermsOfService";

const setup = () =>
render(
<MemoryRouter>
<TermsOfService />
</MemoryRouter>,
);

describe("TermsOfService", () => {
test("renders main content area", () => {
setup();
expect(screen.getByRole("main")).toBeInTheDocument();
});

test("renders the terms of service article element", () => {
setup();
const article = document.querySelector("article.tos-content");
expect(article).toBeInTheDocument();
});

test("renders key terms of service section headings", () => {
setup();
expect(screen.getAllByText(/TERMS OF SERVICE/i).length).toBeGreaterThan(0);
expect(
screen.getAllByText(/AGREEMENT TO OUR LEGAL TERMS/i).length,
).toBeGreaterThan(0);
expect(screen.getAllByText(/TABLE OF CONTENTS/i).length).toBeGreaterThan(0);
expect(
screen.getAllByText(/PROHIBITED ACTIVITIES/i).length,
).toBeGreaterThan(0);
});

test("renders contact email link", () => {
setup();
const emailLinks = screen.getAllByRole("link", {
name: /contact@dharmaduta\.in/i,
});
expect(emailLinks.length).toBeGreaterThan(0);
expect(emailLinks[0]).toHaveAttribute(
"href",
"mailto:contact@dharmaduta.in",
);
});
});
Loading
Loading