-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(material-experimental): add button toggle test harness #16627
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
fb56036
to
0240846
Compare
* Harness for interacting with a mat-button-toggle in tests. | ||
* @dynamic | ||
*/ | ||
export class MatButtonToggleHarness extends ComponentHarness { |
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.
@mmalerba open question here: this harness doesn't allow us to interact with the group that can be around a button toggle. Where would that functionality go? Putting it on the one for the button toggle feels weird, because it won't always be in a group so the alternative is to have a dedicated harness for the button group. That also feels a little weird to me, because you won't have access to the functionality on the toggle harness which defeats the purpose a little bit.
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.
Can't the group harness just expose methods to get harnesses for the individual toggles? (e.g. getActiveButtonToggle()
, getAllButtonToggles()
)
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 can, but I wasn't sure whether we'd want to expose more than one harness per entry point.
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.
Yeah I think its fine to have multiple harness classes in cases where it makes sense. This seems like a good case for it
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.
FWIW: I'm doing similar things to what Miles proposed for the radio-button and radio-group.
0240846
to
932bf32
Compare
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
*/ | ||
|
||
export type ButtonToggleHarnessFilters = { | ||
label?: string | RegExp, |
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.
I think we should use text
for button-like elements since the text is inside the component (vs checkbox and radio where the label accompanies the actual component)
Still needs to be split out into separate harnesses for the button and group |
Adds a test harness for `mat-button-toggle`.
932bf32
to
e3ccecb
Compare
Closing in favor of #17996. |
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. |
Adds a test harness for
mat-button-toggle
.