test: realign verification baseline and supporting tests

This commit is contained in:
Your Name
2026-05-28 15:19:34 +08:00
parent 6be90ddff8
commit 260046a581
31 changed files with 454 additions and 1936 deletions

View File

@@ -416,6 +416,7 @@ describe('DevicesPage', () => {
it('renders page header with title and description', async () => {
render(<DevicesPage />)
await screen.findByText('Device 1')
const header = screen.getByTestId('page-header')
expect(within(header).getByText('设备管理')).toBeInTheDocument()
expect(within(header).getByText('管理系统所有设备,支持查看、信任状态管理和删除')).toBeInTheDocument()

View File

@@ -46,6 +46,7 @@ vi.mock('antd', async () => {
htmlType,
type: buttonType,
icon,
danger,
...props
}: {
children?: ReactNode
@@ -55,6 +56,7 @@ vi.mock('antd', async () => {
}) => {
void buttonType
void icon
void danger
return (
<button type={htmlType ?? 'button'} onClick={onClick} {...props}>

View File

@@ -58,6 +58,9 @@ describe('SettingsPage', () => {
render(<SettingsPage />)
await waitFor(() => {
expect(screen.getByText('安全设置')).toBeInTheDocument()
})
expect(screen.getByText('系统设置')).toBeInTheDocument()
expect(screen.getByText('查看当前系统配置和功能开关状态')).toBeInTheDocument()
})

View File

@@ -18,7 +18,7 @@ vi.mock('@/services/auth', () => ({
function renderActivateAccountPage(initialEntry: string) {
return render(
<MemoryRouter initialEntries={[initialEntry]}>
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }} initialEntries={[initialEntry]}>
<Routes>
<Route path="/activate-account" element={<ActivateAccountPage />} />
</Routes>

View File

@@ -17,7 +17,7 @@ vi.mock('@/services/auth', () => ({
function renderForgotPasswordPage() {
return render(
<MemoryRouter initialEntries={['/forgot-password']}>
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }} initialEntries={['/forgot-password']}>
<Routes>
<Route path="/forgot-password" element={<ForgotPasswordPage />} />
</Routes>

View File

@@ -100,7 +100,7 @@ function renderLoginPage(
} = '/login',
) {
return render(
<MemoryRouter initialEntries={[initialEntry]}>
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }} initialEntries={[initialEntry]}>
<AuthContext.Provider value={authContextValue}>
<LoginPage />
</AuthContext.Provider>

View File

@@ -25,7 +25,7 @@ const authContextValue: AuthContextValue = {
function renderOAuthCallbackPage(entry: string) {
return render(
<MemoryRouter initialEntries={[entry]}>
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }} initialEntries={[entry]}>
<AuthContext.Provider value={authContextValue}>
<OAuthCallbackPage />
</AuthContext.Provider>

View File

@@ -16,7 +16,7 @@ vi.mock('@/services/auth', () => ({
function renderResetPasswordPage(initialEntry: string) {
return render(
<MemoryRouter initialEntries={[initialEntry]}>
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }} initialEntries={[initialEntry]}>
<Routes>
<Route path="/reset-password" element={<ResetPasswordPage />} />
</Routes>