blob: a622c1360cef9a22c8c23ebc29e8bcee7e411a55 [file] [log] [blame]
Krishya57cc17b2025-05-26 16:43:34 +08001// import React from 'react';
2// import { render, screen, fireEvent } from '@testing-library/react';
3// import AuthPage from './AuthPage';
4
5// describe('AuthPage component', () => {
6// test('switches between login and register forms', () => {
7// render(<AuthPage />);
8
9// const registerButton = screen.getByText('点击注册');
10// fireEvent.click(registerButton);
11
12// const usernameInput = screen.getByPlaceholderText('请输入用户名');
13// const passwordInput = screen.getByPlaceholderText('请输入密码');
14// const emailInput = screen.getByPlaceholderText('请输入邮箱');
15
16// expect(usernameInput).toBeInTheDocument();
17// expect(passwordInput).toBeInTheDocument();
18// expect(emailInput).toBeInTheDocument();
19
20// const loginButton = screen.getByText('点击登录');
21// fireEvent.click(loginButton);
22
23// const loginUsernameInput = screen.getByPlaceholderText('请输入用户名');
24// const loginPasswordInput = screen.getByPlaceholderText('请输入密码');
25// const loginSubmitButton = screen.getByText('登录');
26
27// expect(loginUsernameInput).toBeInTheDocument();
28// expect(loginPasswordInput).toBeInTheDocument();
29// expect(loginSubmitButton).toBeInTheDocument();
30// });
31// });