Skip to content

bug(mat-chip-listbox): Harness getChips() does not return mat-chip #28210

Closed
@felhag

Description

@felhag

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

Hello,

When using MatChipListboxHarness.getChips() it only returns mat-chip-option elements, but not mat-chip. Because of this a mat-chip-listbox like this example cannot be tested using the listbox harness. Not sure what is the correct solution for this because it can be solved using mat-chip-set instead of listbox.

Possible solutions imho:

  1. Change example to use mat-chip-set instead of mat-chip-listbox.
  2. Change getChips() signature to return MatChipHarness[] which would be a breaking change.
  3. Add an additional method like getStaticChips().

Reproduction

StackBlitz link: https://stackblitz.com/edit/qykqid

Expected Behavior

MatChipListboxHarness.getChips() should include mat-chip as well.

Actual Behavior

MatChipListboxHarness.getChips() only returns mat-chip-option.

Environment

  • Angular: 17.0.1
  • CDK/Material: 17.0.1
  • Browser(s): -
  • Operating System (e.g. Windows, macOS, Ubuntu): All

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions