angular/components
bug(MatTree): MatTreeHarness with NestedTreeControl returns wrong structure
已关闭
#23,881 创建于 2021年11月3日
P3area: cdk/treehelp wanted
仓库指标
- 星标
- (24,044 个星标)
- PR 合并指标
- (平均合并 3天 12小时) (30 天内合并 98 个 PR)
描述
Reproduction
Steps to reproduce:
- Create a MatTreeComponent with a NestedTreeControl and MatTreeNestedDatasource
- Test the component structure
https://stackblitz.com/edit/harness-issue-xgqlpl?file=src/app/tree-harness-example.spec.ts
Expected Behavior
The structure should have as many children (2 in the Stackblitz example) as visible Nodes.
{ children: [ { text: "Group 1"}, { text: "Group 2"} ] }
Actual Behavior
The structure has only one children without text.
{ children: [ { text: ""} ] }
Environment
- Angular: 12.2.12
- CDK/Material: 12.2.12
- Browser(s): Test Environment
- Operating System (e.g. Windows, macOS, Ubuntu): Windows