-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
test(material-experimental/chips) Port unit tests for mdc chips #16447
Conversation
36d8252
to
c1c3dcb
Compare
6a92696
to
165d853
Compare
Could you expand the commit message to talk a bit about any changes that you had to make? Doing some cursory diffs, it mostly seems like:
|
d865572
to
c00af77
Compare
@jelbourn Commit message updated! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
7d91ffe
to
3ada584
Compare
related to #16173 |
@vanessanschmitt could you rebase the PR? Another change went in that updated all of the BUILD files in the repo for a new version of bazel's nodejs rules (which was somewhat breaking) |
4f4970e
to
d8d10af
Compare
@jelbourn Rebased! |
Ported existing unit tests as follows: - Copied chip-remove.spec. - Copied chip-input.spec and changed its test component template to use grid/row. - Copied chip-list.spec basic tests to chip-set.spec. - Copied chip-list.spec to chip-listbox.spec and removed form-field integration, mat-chip-remove integration, and related keyboard shortcuts. - Copied chip-list.spec to chip-grid.spec and removed the selection behavior. Updated keyboard tests to reflect that it is using GridFocusKeyManager, which has both an active row and an active column. Updated some of the form tests where the value was being changed via selection to change the value in a different way, like by adding a chip. - Copied chip.spec basic tests to chip.spec. - Copied chip.spec to chip-option.spec and removed logic related to user removal of the chip. - Copied chip.spec to chip-row.spec and removed selection logic. Also updated component code to fix bugs/missing features that were caught by the unit tests: - Added missing ControlValueAccessor method setDisabledState to mat-chip-listbox and mat-chip-grid - Stopped overwriting user-defined tab index to mat-chip-listbox and mat-chip-grid. - Removed role from empty mat-chip-listbox and mat-chip-grid. - Added a new subscription in mat-chip-set to chip destroyed events, and moved the logic that updates the lastDestroyedChipIndex out of the removed subscription into the new destroyed subscription. - Replaced _optionChip and _rowChips ViewChildren in mat-chip-listbox and mat-chip-grid with just overriding _chips, to fix bugs where the _chips.changes subscription was trying to do things with _optionChips/_rowChips but those QueryLists were still out of date. - Added placeholder setter to mat-chip-grid. - Added value setter to mat-chip-listbox. - Added injected animationMode to mat-chip and its subcomponents. - Updated rippleConfig to be injected into mat-chip and its subcomponents. - Switched click handler to mousedown handler in mat-chip-row. - Added mat-chip-remove class to remove icon.
d8d10af
to
38596a6
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Ported existing unit tests as follows:
chip-remove.spec
.chip-input.spec
and changed its test component template to use grid/row.chip-list.spec
basic tests tochip-set.spec
.chip-list.spec
tochip-listbox.spec
and removed form-field integration, mat-chip-remove integration, and related keyboard shortcuts.chip-list.spec
tochip-grid.spec
and removed the selection behavior. Updated keyboard tests to reflect that it is usingGridFocusKeyManager
, which has both an active row and an active column. Updated some of the form tests where the value was being changed via selection to change the value in a different way, like by adding a chip.chip.spec
basic tests tochip.spec
.chip.spec
tochip-option.spec
and removed logic related to user removal of the chip.chip.spec
tochip-row.spec
and removed selection logic.Also updated component code to fix bugs/missing features that were caught by the unit tests:
ControlValueAccessor
methodsetDisabledState
to mat-chip-listbox and mat-chip-gridlastDestroyedChipIndex
out of the removed subscription into the new destroyed subscription._optionChip
and_rowChips
ViewChildren
in mat-chip-listbox and mat-chip-grid with just overriding_chips
, to fix bugs where the_chips.changes
subscription was trying to do things with_optionChips
/_rowChips
but those QueryLists were still out of date.placeholder
setter to mat-chip-grid.value
setter to mat-chip-listbox.animationMode
to mat-chip and its subcomponents.rippleConfig
to be injected into mat-chip and its subcomponents.