test: add Stage 3-5 component and layout test coverage

Add tests for:
- PageLayout components: ContentCard, FilterCard, TableCard, TreeCard, PageLayout
- AuthLayout layout component
- LoginLogDetailDrawer and OperationLogDetailDrawer page components

All 518 tests pass across 82 test files.
This commit is contained in:
2026-04-18 07:46:42 +08:00
parent 40d146b6aa
commit 8b8c05bb60
8 changed files with 574 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
import { render, screen } from '@testing-library/react'
import { describe, expect, it } from 'vitest'
import { AuthLayout } from './AuthLayout'
describe('AuthLayout', () => {
it('renders children in the form area', () => {
render(
<AuthLayout>
<div>login form</div>
</AuthLayout>,
)
expect(screen.getByText('login form')).toBeInTheDocument()
})
it('displays the brand title', () => {
render(
<AuthLayout>
<div>content</div>
</AuthLayout>,
)
expect(screen.getByText('用户管理系统')).toBeInTheDocument()
})
it('displays brand description', () => {
render(
<AuthLayout>
<div>content</div>
</AuthLayout>,
)
expect(screen.getByText('企业级用户管理解决方案')).toBeInTheDocument()
})
it('displays feature list', () => {
render(
<AuthLayout>
<div>content</div>
</AuthLayout>,
)
expect(screen.getByText('支持多种登录方式')).toBeInTheDocument()
expect(screen.getByText('基于角色的权限控制')).toBeInTheDocument()
expect(screen.getByText('完整的审计日志')).toBeInTheDocument()
expect(screen.getByText('安全的双因素认证')).toBeInTheDocument()
})
})