去掉系统已打开页面页签及无用关闭入口和样式;保留面包屑、来源路径与分页。左侧文字16px、图标20px,导航项最小44px。 验证:顶部页签移除与导航字号回归分别先红后绿,相关测试和类型检查通过;完整门禁与部署验收待执行。
This commit is contained in:
+13
-11
@@ -28,7 +28,6 @@ describe('WorkspaceShell', () => {
|
||||
<WorkspaceShell
|
||||
workspace={{ openTabs: ['dashboard'], activeTab: 'dashboard' }}
|
||||
onOpen={vi.fn()}
|
||||
onClose={vi.fn()}
|
||||
>
|
||||
<div>工作区内容</div>
|
||||
</WorkspaceShell>,
|
||||
@@ -44,36 +43,38 @@ describe('WorkspaceShell', () => {
|
||||
expect(html).not.toContain('P2 本地治理环境')
|
||||
})
|
||||
|
||||
it('renders open tabs and marks the active tab', () => {
|
||||
it('omits the system open-page tab strip while retaining navigation and the current location', () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<WorkspaceShell
|
||||
workspace={{ openTabs: ['dashboard', 'tasks', 'releases'], activeTab: 'tasks' }}
|
||||
onOpen={vi.fn()}
|
||||
onClose={vi.fn()}
|
||||
>
|
||||
<div>工作区内容</div>
|
||||
</WorkspaceShell>,
|
||||
)
|
||||
|
||||
expect(html).toContain('aria-label="已打开页面"')
|
||||
expect(html).not.toContain('aria-label="已打开页面"')
|
||||
expect(html).not.toContain('class="tab-list"')
|
||||
expect(html).not.toContain('class="workspace-tab')
|
||||
expect(html).toContain('来源与目录')
|
||||
expect(html).toContain('解析监控')
|
||||
expect(html).toContain('发布管理')
|
||||
expect(html).toContain('aria-current="page"')
|
||||
expect(html).toContain('aria-label="当前位置"')
|
||||
expect(html).toContain('<b>解析监控</b>')
|
||||
expect(html).toContain('class="nav-item active"')
|
||||
})
|
||||
|
||||
it('offers close controls only for unpinned tabs', () => {
|
||||
it('does not render obsolete module-tab close controls', () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<WorkspaceShell
|
||||
workspace={{ openTabs: ['dashboard', 'tasks'], activeTab: 'tasks' }}
|
||||
onOpen={vi.fn()}
|
||||
onClose={vi.fn()}
|
||||
>
|
||||
<div>工作区内容</div>
|
||||
</WorkspaceShell>,
|
||||
)
|
||||
|
||||
expect(html).toContain('aria-label="关闭解析监控标签"')
|
||||
expect(html).not.toContain('aria-label="关闭解析监控标签"')
|
||||
expect(html).not.toContain('aria-label="关闭来源与目录标签"')
|
||||
})
|
||||
|
||||
@@ -82,7 +83,6 @@ describe('WorkspaceShell', () => {
|
||||
<WorkspaceShell
|
||||
workspace={{ openTabs: ['dashboard'], activeTab: 'dashboard' }}
|
||||
onOpen={vi.fn()}
|
||||
onClose={vi.fn()}
|
||||
>
|
||||
<div>工作区内容</div>
|
||||
</WorkspaceShell>,
|
||||
@@ -94,11 +94,13 @@ describe('WorkspaceShell', () => {
|
||||
})
|
||||
|
||||
describe('App', () => {
|
||||
it('renders the dashboard inside the multi-tab workspace by default', () => {
|
||||
it('renders the dashboard inside the workspace without the system page tabs', () => {
|
||||
const html = renderToStaticMarkup(<App />)
|
||||
|
||||
expect(html).toContain('aria-label="功能导航"')
|
||||
expect(html).toContain('aria-label="已打开页面"')
|
||||
expect(html).not.toContain('aria-label="已打开页面"')
|
||||
expect(html).not.toContain('class="tab-list"')
|
||||
expect(html).not.toContain('class="workspace-tab')
|
||||
expect(html).toContain('<h1>来源与目录</h1>')
|
||||
expect(html).not.toContain('最近任务')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user