Skip to content

fix(material-experimental/mdc-chips): align test harnesses with the non-MDC version #21051

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

Merged
merged 1 commit into from
Nov 17, 2020

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Nov 15, 2020

Aligns the test harnesses of the MDC-based chips module with the ones from the non-MDC version. Overview of the changes:

  • MatChipGridHarness - getTextInput was renamed to getInput to match the non-MDC list harness. Also adds a few utility methods to check whether the grid is disabled, required etc.
  • MatChipHarness - adds support for the same set of filters when querying for the harness. Also adds a method to get the removal button and disabled state.
  • MatChipInputHarness - adds a bunch of utility methods that we have on the other input-related harnesses. Also implemets the same set of harness filters as the non-MDC harness.
  • MatChipListboxHarness - Renames getOptions to getChips for consistency and removes the getSelected method in favor of filtering selected chips through the harness predicate. Also adds some utility methods for selecting chips, getting the disabled and required states etc.
  • MatChipOptionHarness - implements harness filters and adds APIs for selecting/deselecting.
  • MatChipRemoveHarness - new harness which is identical to the non-MDC MatChipRemoveHarness.
  • MatChipSetHarness - supports filtering through the getChips method.

These changes also include tests for all the new functionality and minor cleanups around the mdc-chips/testing package.

@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release labels Nov 15, 2020
@crisbeto crisbeto requested a review from mmalerba as a code owner November 15, 2020 13:40
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 15, 2020
@crisbeto crisbeto added the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Nov 15, 2020
@crisbeto
Copy link
Member Author

Caretaker note: I've had to make a few breaking changes to public APIs in order to align them with the non-MDC versions. The changes aren't going through the same breaking change process, because they're still under material-experimental.

…on-MDC version

Aligns the test harnesses of the MDC-based chips module with the ones from the non-MDC version.
Overview of the changes:
* `MatChipGridHarness` - `getTextInput` was renamed to `getInput` to match the non-MDC list harness.
Also adds a few utility methods to check whether the grid is disabled, required etc.
* `MatChipHarness` - adds support for the same set of filters when querying for the harness. Also
adds a method to get the removal button and disabled state.
* `MatChipInputHarness` - adds a bunch of utility methods that we have on the other input-related
harnesses. Also implemets the same set of harness filters as the non-MDC harness.
* `MatChipListboxHarness` - Renames `getOptions` to `getChips` for consistency and removes the
`getSelected` method in favor of filtering selected chips through the harness predicate. Also
adds some utility methods for selecting chips, getting the disabled and required states etc.
* `MatChipOptionHarness` - implements harness filters and adds APIs for selecting/deselecting.
* `MatChipRemoveHarness` - new harness which is identical to the non-MDC `MatChipRemoveHarness`.
* `MatChipSetHarness` - supports filtering through the `getChips` method.

These changes also include tests for all the new functionality and minor cleanups around the
`mdc-chips/testing` package.
@crisbeto crisbeto force-pushed the mdc-chips-consoldation branch from 432d365 to 69c4610 Compare November 16, 2020 16:42
@crisbeto
Copy link
Member Author

The feedback has been addressed.

@mmalerba mmalerba added the action: merge The PR is ready for merge by the caretaker label Nov 16, 2020
Copy link
Contributor

@mmalerba mmalerba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wagnermaciel wagnermaciel added target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Nov 17, 2020
@wagnermaciel wagnermaciel merged commit b07c539 into angular:master Nov 17, 2020
@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 Dec 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note P2 The issue is important to a large percentage of users, with a workaround target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants