Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mat Chip Test Harness: Support editing chips using the test harness #26419

Closed
0acwilliams0 opened this issue Jan 12, 2023 · 1 comment · Fixed by #26442
Closed

Mat Chip Test Harness: Support editing chips using the test harness #26419

0acwilliams0 opened this issue Jan 12, 2023 · 1 comment · Fixed by #26442
Assignees
Labels
area: material/chips area: material/testing feature This issue represents a new feature or feature request rather than a bug or bug fix G This is is related to a Google internal issue

Comments

@0acwilliams0
Copy link

Feature Description

matChipInputFor allows editing input values after a chip has been created (e.g. https://material.angular.io/components/chips/examples#chips-input), however, none of the relevant test harnesses support performing an edit action (e.g. https://material.angular.io/components/chips/api#MatChipRowHarness). There appears to be a isEditing() method, but no apparent way to use the test harness to get the chip row into an editing state (and no way to actually perform the edit even if you do manage to start editing via const host = await chipRow.host(); await host.sendKeys(TestKey.ENTER)).

Use Case

Editing chips is finicky and non-trivial to simulate in test code. Without this feature, components that support chip input editing either have to:

  • Not test their editing functionality OR
  • Use brittle and unreliable methods of triggering and performing the edit e.g. directly accessing the matChipInput instance or the editable span.
@0acwilliams0 0acwilliams0 added feature This issue represents a new feature or feature request rather than a bug or bug fix needs triage This issue needs to be triaged by the team labels Jan 12, 2023
@jelbourn jelbourn added G This is is related to a Google internal issue area: material/chips area: material/testing and removed needs triage This issue needs to be triaged by the team labels Jan 12, 2023
@crisbeto crisbeto self-assigned this Jan 17, 2023
crisbeto added a commit to crisbeto/material2 that referenced this issue Jan 17, 2023
Adds the ability to start editing a chip, change its value, and finish editing it through test harnesses.

Fixes angular#26419.
crisbeto added a commit to crisbeto/material2 that referenced this issue Jan 17, 2023
Adds the ability to start editing a chip, change its value, and finish editing it through test harnesses.

Fixes angular#26419.
crisbeto added a commit to crisbeto/material2 that referenced this issue Jan 17, 2023
Adds the ability to start editing a chip, change its value, and finish editing it through test harnesses.

Fixes angular#26419.
crisbeto added a commit that referenced this issue Jan 18, 2023
Adds the ability to start editing a chip, change its value, and finish editing it through test harnesses.

Fixes #26419.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/chips area: material/testing feature This issue represents a new feature or feature request rather than a bug or bug fix G This is is related to a Google internal issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants