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:
49
frontend/admin/src/layouts/AuthLayout/AuthLayout.test.tsx
Normal file
49
frontend/admin/src/layouts/AuthLayout/AuthLayout.test.tsx
Normal 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()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user