Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
WendyHuang26 authored Dec 14, 2024
1 parent a9d6c17 commit 3bc819d
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/RequestsTest.jsx
Original file line number Diff line number Diff line change
@@ -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(
<BrowserRouter>
<LandingPage />
</BrowserRouter>
);
});

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");
});
});

0 comments on commit 3bc819d

Please sign in to comment.