diff --git a/src/RequestsTest.jsx b/src/RequestsTest.jsx new file mode 100644 index 0000000..43a694a --- /dev/null +++ b/src/RequestsTest.jsx @@ -0,0 +1,28 @@ +import { render, screen, fireEvent } from "@testing-library/react"; +import { describe, it, expect, beforeEach } from "vitest"; +import { BrowserRouter } from "react-router-dom"; +import LandingPage from "../src/pages/landingPage/landingPage"; // Updated correct path + +describe("Landing Page Navigation Tests", () => { + beforeEach(() => { + render( + + + + ); + }); + + it("should display landing page with student option and navigate to student page", () => { + // Verify landing page elements are present + expect(screen.getByText(/welcome to/i)).toBeInTheDocument(); + expect(screen.getByText("OHours")).toBeInTheDocument(); + + // Find and click the Students link + const studentLink = screen.getByRole("link", { name: /students/i }); + expect(studentLink).toHaveAttribute("href", "/student"); + + // Verify the Staff option is also present + const staffLink = screen.getByRole("link", { name: /staff/i }); + expect(staffLink).toHaveAttribute("href", "/PMLand"); + }); +}); \ No newline at end of file