blob: ade54e85fa8d3d8413bd1c8d18be9ffaa3421c5a [file] [log] [blame]
2230101462240ab2025-06-07 09:28:16 +08001import { render, screen } from '@testing-library/react'
2import Login from '../../feature/auth/Login'
3import { Provider } from 'react-redux'
4import { store } from '../../store/store'
5import { MemoryRouter } from 'react-router'
6
7describe('Login Page', () => {
8 it('renders login form', () => {
9 render(
10 <MemoryRouter>
11 <Provider store={store}>
12 <Login />
13 </Provider>
14 </MemoryRouter>
15
16 )
17
18 const emailInput = screen.getByPlaceholderText('账号(注册邮箱)')
19 const passwordInput = screen.getByPlaceholderText('密码')
20 const loginButton = screen.getByRole('button', { name: /登录/i })
21
22
23 expect(emailInput).toBeInTheDocument()
24 expect(passwordInput).toBeInTheDocument()
25 expect(loginButton).toBeInTheDocument()
26 })
27})