Skip to content

Commit

Permalink
genai tests
Browse files Browse the repository at this point in the history
  • Loading branch information
terrylinhaochen committed Nov 15, 2024
1 parent 3785354 commit c785c15
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/landingPage.Chen-genai.test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { describe, it, vi, expect } from 'vitest';
import { render, screen } from '@testing-library/react';
import { BrowserRouter } from 'react-router-dom';
import LandingPage from '../src/pages/landingPage/landingPage';

describe('Landing Page Navigation', () => {
it('should show navigation options', () => {
render(
<BrowserRouter>
<LandingPage />
</BrowserRouter>
);

// Check for the main header elements
const welcomeText = screen.getByText(/welcome to/i);
const oHoursText = screen.getByText('OHours');
expect(welcomeText).toBeInTheDocument();
expect(oHoursText).toBeInTheDocument();

// Check for navigation links
const studentLink = screen.getByRole('link', { name: /students/i });
const staffLink = screen.getByRole('link', { name: /staff/i });
expect(studentLink).toHaveAttribute('href', '/student');
expect(staffLink).toHaveAttribute('href', '/PMLand');
});
});

0 comments on commit c785c15

Please sign in to comment.