-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(select,input,form-field): move test harnesses out of experimental #17874
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
Conversation
import { | ||
MatFormFieldControlHarness | ||
} from '@angular/material-experimental/form-field/testing/control'; | ||
import {MatFormFieldControlHarness} from '@angular/material/form-field/testing/control'; | ||
import {SelectHarnessFilters} from './select-harness-filters'; | ||
import {MatSelectOptionHarness, MatSelectOptionGroupHarness} from './option-harness'; |
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.
Note that we have a harness for an option inside mat-select
, as well as for an option in mat-autocomplete
. Once this PR is merged in I can remove the duplication and add a single, fully-featured harness for mat-option
in core
.
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.
It would be really nice if we could get that in before final. I forgot that autocomplete was already moved out of experimental with the split mat-option harness
604f742
to
3554b2b
Compare
Setting to P2 since there's other work that depends on these changes. |
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
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.
Sorry, it won't let me add comments inline since the lines are unedited, but here's a breakdown by class of changes I think we should make before moving this API out of experimental:
Also, do a pass on the API docs, make sure they are consistent with other harnesses (in particular I noticed |
3554b2b
to
ccd7b45
Compare
@mmalerba I've updated the harnesses based on your feedback, aside from a couple of issues:
|
Discussed with @crisbeto on slack. After thinking about it more, I agree that those two don't make sense |
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.
Do you have a particular use case in mind for MatSelectHarness#getPanel
? I'd prefer to remove it, it goes against my rule of thumb about exposing TestElement
.
9dc54c7
to
13e1fab
Compare
I added |
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.
- Do you disagree on renaming
getErrorMessages
andgetHintMessages
or did you just miss it? My reasoning is that in other harnesses we named methods like that when they returned the text of the element rather than the element itself - It looks like option is not exported from public-api for select
getOptionGroups
should also take optional filters- The doc comments for filter classes and
with
methods still needs to be udated
const [isMultiple, options] = await Promise.all([this.isMultiple(), this.getOptions(filter)]); | ||
|
||
if (isMultiple) { | ||
await Promise.all(options.map(option => option.click())); |
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.
Based on the name of this method, I would expect it to call select
on the option rather than click
(which is effectively toggle). Maybe we can change this to call select()
on the options and then also have a deselect()
method that calls deselect()
on the options.
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.
These are the custom mat-option
elements so we don't have access to the select/deselect methods. Should I rename it to click
instead?
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.
You can leave it as is for now and leave a TODO to split out separate select/deselect methods later
13e1fab
to
8158a04
Compare
@mmalerba I've addressed the latest set the feedback, aside from exposing the option harnesses. I haven't exposed or documented them properly yet, because their code is duplicated between |
I'm hesitant about just merging this and doing the option stuff in a follow up because I don't want this temporary state API to wind up in an RC, or worse final if the follow-up doesn't make it in in time. I would suggest doing the common option first and putting this one on hold until that's in. cc @jelbourn |
I can put together the option PR for Monday so we have some time to merge it in for final. I would've made a shared option harness to begin with, but the autocomplete and select harnesses started off in experimental and we don't have a |
I'm fine with doing this in two steps since I just did an RC today and will know not to do another one until we consolidate |
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.
Ok, last couple things then we can merge
8158a04
to
43b708b
Compare
Addressed the last few things @mmalerba. |
43b708b
to
9a27bda
Compare
Moves the test harnesses for the `select`, `input` and `form-field` packages out of `material-experimental`.
9a27bda
to
5ea84c1
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. |
Moves the test harnesses for the
select
,input
andform-field
packages out ofmaterial-experimental
.