feat: enrich admin project list overview

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
jesxion
2026-04-26 18:17:12 +08:00
parent a225d0f0e3
commit d55ef56f31
2 changed files with 7 additions and 8 deletions

View File

@@ -83,9 +83,8 @@ export default function ProjectListPage() {
<section className="admin-overview">
<div className="admin-section-heading">
<div>
<span className="admin-section-heading__eyebrow"></span>
<h2></h2>
<p></p>
<h2></h2>
<p className="admin-section-heading__supporting"> </p>
</div>
<Button type="primary" icon={<PlusOutlined />} onClick={() => setModalOpen(true)}>

View File

@@ -66,7 +66,7 @@ describe('ProjectListPage', () => {
</BrowserRouter>,
)
expect(await screen.findByText('项目总览')).toBeInTheDocument()
expect(await screen.findByRole('heading', { name: '项目总览' })).toBeInTheDocument()
expect(screen.getByText('项目总数')).toBeInTheDocument()
expect(screen.getByText('账号总数')).toBeInTheDocument()
expect(screen.getByPlaceholderText('搜索项目名称')).toBeInTheDocument()
@@ -79,7 +79,7 @@ describe('ProjectListPage', () => {
<ProjectListPage />
</BrowserRouter>,
)
await screen.findByText('项目总览')
await screen.findByRole('heading', { name: '项目总览' })
const accountKpiCard = screen.getByText('账号总数').closest('article')!
expect(within(accountKpiCard).getByText('--')).toBeInTheDocument()
expect(within(accountKpiCard).getByText('暂无账号数据')).toBeInTheDocument()
@@ -101,7 +101,7 @@ describe('ProjectListPage', () => {
<ProjectListPage />
</BrowserRouter>,
)
await screen.findByText('项目总览')
await screen.findByRole('heading', { name: '项目总览' })
const accountKpiCard = screen.getByText('账号总数').closest('article')!
expect(within(accountKpiCard).getByText('--')).toBeInTheDocument()
expect(within(accountKpiCard).getByText('暂无账号数据')).toBeInTheDocument()
@@ -123,7 +123,7 @@ describe('ProjectListPage', () => {
<ProjectListPage />
</BrowserRouter>,
)
await screen.findByText('项目总览')
await screen.findByRole('heading', { name: '项目总览' })
const accountKpiCard = screen.getByText('账号总数').closest('article')!
expect(within(accountKpiCard).getByText('8')).toBeInTheDocument()
expect(within(accountKpiCard).getByText('项目管理员与项目经理账号')).toBeInTheDocument()
@@ -226,7 +226,7 @@ describe('ProjectListPage', () => {
</BrowserRouter>,
)
await screen.findByText('项目总览')
await screen.findByRole('heading', { name: '项目总览' })
const refreshButton = screen.getByRole('button', { name: '刷新列表' })
expect(refreshButton).not.toBeDisabled()