test: realign verification baseline and supporting tests
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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}>
|
||||
|
||||
@@ -58,6 +58,9 @@ describe('SettingsPage', () => {
|
||||
|
||||
render(<SettingsPage />)
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByText('安全设置')).toBeInTheDocument()
|
||||
})
|
||||
expect(screen.getByText('系统设置')).toBeInTheDocument()
|
||||
expect(screen.getByText('查看当前系统配置和功能开关状态')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user