Skip to content

Commit

Permalink
test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestjx committed Oct 27, 2024
1 parent 8fbfdaa commit 42e3c89
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions test/(main)/classes/details/page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,27 +63,11 @@ vi.mock('@/service/UserService', () => ({
beforeEach(() => {
(useRouter as Mock).mockReturnValue(mockRouter);
(useSearchParams as Mock).mockReturnValue({ get: vi.fn(() => '1') });

// Reset mocks between tests
// mockGetClassById.mockReset();
// mockRemoveStudentsFromClass.mockReset();
// mockSendInvitation.mockReset();
mockRouter.push.mockReset();
});

describe('ClassDetails Component', () => {
it('renders ClassDetails component and loads data', async () => {
// const classData = {
// id: 1,
// description: 'Physics 101',
// tutors: [{ firstName: 'Jane', lastName: 'Doe', email: 'jane.doe@example.com', educationLevel: 'PhD' }],
// classInvitations: [
// { userEmail: 'student1@example.com', status: 'Pending', firstName: 'Student', lastName: 'One' },
// ],
// };

// mockGetClassById.mockResolvedValue(classData);

render(<Page />);
await waitFor(() => expect(UserService.getClassById).toHaveBeenCalledWith('1'));
expect(screen.getByText('Physics 101')).toBeInTheDocument();
Expand Down

0 comments on commit 42e3c89

Please sign in to comment.