vault-video-processor / src /lib /__tests__ /components.test.tsx
dvijaykrishnan's picture
Removed analytics and trending features, added test and verification result files, and updated existing feature components and tests.
980bfc2
Raw
History Blame Contribute Delete
1.13 kB
import { describe, it, expect, vi, afterEach } from 'vitest';
import { render, screen, cleanup } from '@testing-library/react';
import { SignUpForm } from '../../components/auth/sign-up-form';
import { SignInForm } from '../../components/auth/sign-in-form';
afterEach(() => {
cleanup();
});
// Mock the auth client since it's used in components
vi.mock('@/lib/auth-client', () => ({
signIn: {
email: vi.fn(),
},
signUp: {
email: vi.fn(),
},
}));
// Mock next/navigation
vi.mock("next/navigation", () => ({
useRouter: () => ({
push: vi.fn(),
replace: vi.fn(),
prefetch: vi.fn(),
}),
useSearchParams: () => new URLSearchParams(),
usePathname: () => "/",
}));
describe('Auth Components', () => {
it('should render SignUpForm', () => {
render(<SignUpForm />);
expect(screen.getByRole('button', { name: /continue with google/i })).toBeDefined();
});
it('should render SignInForm', () => {
render(<SignInForm />);
expect(screen.getByRole('button', { name: /continue with google/i })).toBeDefined();
});
});