仅按区域显示真实部门名称与完整路径悬停,替代部门数量折叠摘要;适配人员与部门列宽,按人视图保持原样。归属、统计与分页不变。 验证:真实节点名称、区域直显且按人不变、区域列宽分别先红后绿,14项相关测试与类型检查通过。完整门禁、候选和上线验收待执行。
This commit is contained in:
@@ -24,6 +24,29 @@ it('renders at most fifty ranked people with actual question counts and no depar
|
||||
expect(html).not.toContain('checkbox')
|
||||
expect(html).not.toContain('绑定选中部门')
|
||||
})
|
||||
it('shows region department names immediately with full-path titles while leaving all-person details unchanged', () => {
|
||||
const data = fixture()
|
||||
data.rows.find((d) => d.id === 'root')!.name = '研发/视觉'
|
||||
const html = renderToStaticMarkup(<PeopleAnalysisView data={data} mode="regions" />)
|
||||
expect(html).toContain('qa-people-departments-inline')
|
||||
expect(html).toContain('title="研发/视觉/Fixture Child"')
|
||||
expect(html).toContain('>研发/视觉</li>')
|
||||
expect(html).toContain('>Fixture Child</li>')
|
||||
expect(html).not.toContain('<summary')
|
||||
expect(html).not.toContain('个直属部门')
|
||||
const all = renderToStaticMarkup(<PeopleAnalysisView data={data} mode="people" />)
|
||||
expect(all).toContain('<summary')
|
||||
expect(all).toContain('个直属部门')
|
||||
})
|
||||
it('widens region names and departments without changing all-person column widths', () => {
|
||||
const data = fixture()
|
||||
const widths = (mode: 'regions' | 'people') =>
|
||||
[
|
||||
...renderToStaticMarkup(<PeopleAnalysisView data={data} mode={mode} />).matchAll(/<col style="width:(\d+)%"/g),
|
||||
].map((m) => Number(m[1]))
|
||||
expect(widths('regions')).toEqual([6, 20, 9, 36, 9, 20])
|
||||
expect(widths('people')).toEqual([6, 19, 16, 29, 10, 20])
|
||||
})
|
||||
it('region analysis lists the saved region members once and all-person analysis retains unassigned and zero-use people', () => {
|
||||
const data = fixture()
|
||||
const region = renderToStaticMarkup(<PeopleAnalysisView data={data} mode="regions" />)
|
||||
|
||||
Reference in New Issue
Block a user