-
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
fix(chips/testing): exclude icons from getText result #20508
Conversation
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.
Nice! LGTM
@@ -31,7 +31,7 @@ export class MatChipHarness extends ComponentHarness { | |||
|
|||
/** Gets the text of the chip. */ | |||
async getText(): Promise<string> { | |||
return (await this.host()).text(); | |||
return (await this.host()).text({exclude: '.mat-chip-avatar, .mat-chip-trailing-icon'}); |
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.
Should also exclude .mat-icon
, see #20503 (comment)
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.
@crisbeto do you know if we expect people to use mat-icon directly in mat-chip without marking it as an avatar or trailing icon?
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 believe that all our examples go through the avatar or the trailing icon directives. I've added .mat-icon
to the selector anyway since it doesn't require any maintenance on our end.
Excludes the text of icons from the result of the `getText` method. Fixes angular#20503.
8e2a633
to
1490e98
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
Please also see #20503 (comment) - the with() method may also need to be updated. |
The |
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. |
Excludes the text of icons from the result of the
getText
method.Fixes #20503.