test: realign verification baseline and supporting tests
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
import { Spin, Button, Result, Empty, type ButtonProps } from 'antd'
|
||||
import { ReloadOutlined, PlusOutlined } from '@ant-design/icons'
|
||||
import type { ReactNode } from 'react'
|
||||
import { Children, type ReactNode } from 'react'
|
||||
import styles from './PageState.module.css'
|
||||
|
||||
// ==================== PageLoading ====================
|
||||
@@ -94,19 +94,14 @@ export function PageError({
|
||||
status="error"
|
||||
title={title}
|
||||
subTitle={description}
|
||||
extra={[
|
||||
onRetry && (
|
||||
<Button
|
||||
key="retry"
|
||||
type="primary"
|
||||
icon={<ReloadOutlined />}
|
||||
onClick={onRetry}
|
||||
>
|
||||
extra={Children.toArray([
|
||||
onRetry ? (
|
||||
<Button type="primary" icon={<ReloadOutlined />} onClick={onRetry}>
|
||||
{retryText}
|
||||
</Button>
|
||||
),
|
||||
) : null,
|
||||
extra,
|
||||
].filter(Boolean)}
|
||||
])}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -51,7 +51,7 @@ describe('RequireAuth', () => {
|
||||
it('shows a loading indicator while auth state is being restored', () => {
|
||||
const { container } = renderWithAuth(
|
||||
{ isLoading: true },
|
||||
<MemoryRouter initialEntries={['/users']}>
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }} initialEntries={['/users']}>
|
||||
<Routes>
|
||||
<Route
|
||||
path="/users"
|
||||
@@ -72,7 +72,7 @@ describe('RequireAuth', () => {
|
||||
it('redirects unauthenticated users to login and preserves the original route', async () => {
|
||||
renderWithAuth(
|
||||
{ isAuthenticated: false, isLoading: false },
|
||||
<MemoryRouter initialEntries={['/users']}>
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }} initialEntries={['/users']}>
|
||||
<Routes>
|
||||
<Route
|
||||
path="/users"
|
||||
@@ -106,7 +106,7 @@ describe('RequireAuth', () => {
|
||||
status: 1,
|
||||
},
|
||||
},
|
||||
<MemoryRouter initialEntries={['/users']}>
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }} initialEntries={['/users']}>
|
||||
<Routes>
|
||||
<Route
|
||||
path="/users"
|
||||
@@ -128,7 +128,7 @@ describe('RequireAdmin', () => {
|
||||
it('waits silently while auth state is still loading', () => {
|
||||
const { container } = renderWithAuth(
|
||||
{ isLoading: true, isAdmin: false },
|
||||
<MemoryRouter initialEntries={['/dashboard']}>
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }} initialEntries={['/dashboard']}>
|
||||
<Routes>
|
||||
<Route
|
||||
path="/dashboard"
|
||||
@@ -148,7 +148,7 @@ describe('RequireAdmin', () => {
|
||||
it('redirects non-admin users to profile', async () => {
|
||||
renderWithAuth(
|
||||
{ isLoading: false, isAdmin: false, isAuthenticated: true },
|
||||
<MemoryRouter initialEntries={['/dashboard']}>
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }} initialEntries={['/dashboard']}>
|
||||
<Routes>
|
||||
<Route
|
||||
path="/dashboard"
|
||||
@@ -169,7 +169,7 @@ describe('RequireAdmin', () => {
|
||||
it('renders admin-only content for admins', () => {
|
||||
renderWithAuth(
|
||||
{ isLoading: false, isAdmin: true, isAuthenticated: true },
|
||||
<MemoryRouter initialEntries={['/dashboard']}>
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }} initialEntries={['/dashboard']}>
|
||||
<Routes>
|
||||
<Route
|
||||
path="/dashboard"
|
||||
|
||||
Reference in New Issue
Block a user