Skip to content

feat(material/testing): Add trigger icon name filtering to MatMenuHarness #32181

@wein2011

Description

@wein2011

Feature Description

At this point it is easy to filter for a MatMenuHarness that is triggered from a text button using triggerText, but it is more difficult to filter for a MatMenuHarness that is triggered from an icon button.

Similar to the feature that was added in release 21.0.0-next.5 that added icon name filtering to MatButtonHarness (#31852), it would be great to be able to simply filter the MatMenuHarness based on the icon name of the trigger button:

<button matIconButton type="button" [matMenuTriggerFor]="menu">
  <mat-icon svgIcon="edit" />
</button>

<mat-menu #menu>
</mat-menu>
const menu = await loader.getHarness(MatMenuHarness.with({ triggerIconName: "edit" }));

Use Case

No response

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/menufeatureThis issue represents a new feature or feature request rather than a bug or bug fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions