Skip to content

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

Closed
wants to merge 1 commit into from

Conversation

crisbeto
Copy link
Member

Adds a test harness for mat-button-toggle.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jul 28, 2019
@crisbeto crisbeto force-pushed the button-toggle-harness branch from fb56036 to 0240846 Compare July 28, 2019 12:07
* Harness for interacting with a mat-button-toggle in tests.
* @dynamic
*/
export class MatButtonToggleHarness extends ComponentHarness {
Copy link
Member Author

@crisbeto crisbeto Jul 28, 2019

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.

Copy link
Contributor

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())

Copy link
Member Author

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.

Copy link
Contributor

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

Copy link
Member

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.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent pr: merge safe target: patch This PR is targeted for the next patch release labels Jul 28, 2019
@crisbeto crisbeto force-pushed the button-toggle-harness branch from 0240846 to 932bf32 Compare July 28, 2019 12:33
@crisbeto crisbeto marked this pull request as ready for review July 28, 2019 12:33
@crisbeto crisbeto requested a review from jelbourn as a code owner July 28, 2019 12:33
Copy link
Member

@jelbourn jelbourn left a 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,
Copy link
Member

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)

@mmalerba
Copy link
Contributor

mmalerba commented Aug 23, 2019

Still needs to be split out into separate harnesses for the button and group

Adds a test harness for `mat-button-toggle`.
@crisbeto crisbeto force-pushed the button-toggle-harness branch from 932bf32 to e3ccecb Compare October 1, 2019 19:28
@crisbeto crisbeto requested a review from a team as a code owner October 1, 2019 19:28
@crisbeto
Copy link
Member Author

Closing in favor of #17996.

@crisbeto crisbeto closed this Dec 18, 2019
@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 Jan 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants