gongxiangp2/components/department-dashboard/workspace-navigation.test.ts
2026-09-07 12:20:03 +08:00

43 lines
1.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import {
getFrameworkWorkspaceParams,
getWorkspaceItem,
WORKSPACE_SECTIONS,
} from './workspace-navigation'
describe('workspace navigation', () => {
it('为17个小项提供唯一入口,并为未接入项生成独立框架页', () => {
const items = WORKSPACE_SECTIONS.flatMap((section) => section.items)
const hrefs = items.map((item) => item.href)
expect(items).toHaveLength(17)
expect(new Set(hrefs).size).toBe(17)
expect(getFrameworkWorkspaceParams()).toHaveLength(10)
expect(getWorkspaceItem('dashboard', 'core-metrics')?.item.title).toBe('核心指标')
expect(getWorkspaceItem('assets', 'material-library')?.item.status).toBe('connected')
expect(getWorkspaceItem('assets', 'automation-workflows')?.item.status).toBe('connected')
expect(getWorkspaceItem('assets', 'value-metrics')?.item).toMatchObject({
status: 'connected',
productName: '素材资产库复用率',
})
expect(getWorkspaceItem('governance', 'roles-permissions')?.item).toMatchObject({
title: '权限组',
href: '/workspaces/governance/roles-permissions',
status: 'connected',
})
expect(getWorkspaceItem('governance', 'user-permissions')?.item).toMatchObject({
title: '按人看权限',
href: '/workspaces/governance/user-permissions',
status: 'connected',
})
expect(getWorkspaceItem('organization', 'people-structure')?.item).toMatchObject({
href: '/workspaces/organization/people-structure',
status: 'connected',
productName: '品牌中心人员架构',
})
expect(getWorkspaceItem('governance', 'data-definitions')?.item).toMatchObject({
status: 'connected',
productName: '公司组织架构',
})
})
})