Skip to content

bug(MatTree): MatTreeHarness with NestedTreeControl returns wrong structure #23881

Open
@sikelerd

Description

@sikelerd

Reproduction

Steps to reproduce:

  1. Create a MatTreeComponent with a NestedTreeControl and MatTreeNestedDatasource
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/treehelp wantedThe team would appreciate a PR from the community to address this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions