gongxiangp2/components/department-dashboard/workspace-navigation.test.ts
chenpei 683f86c7af feat: 权限组可挂部门和多人
一组就是一份权限。部门进组当底子,人进组当加餐,能看的取并集。
2026-08-20 12:41:12 +08:00

39 lines
1.5 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('为23个小项提供唯一入口,并为未接入项生成独立框架页', () => {
const items = WORKSPACE_SECTIONS.flatMap((section) => section.items)
const hrefs = items.map((item) => item.href)
expect(items).toHaveLength(23)
expect(new Set(hrefs).size).toBe(23)
expect(getFrameworkWorkspaceParams()).toHaveLength(17)
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('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: '公司组织架构',
})
})
})