-
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(menu): Set menu-item icon color only when not set on mat-icon #8614
Conversation
Set the theme icon color only if the `color` input property was not set on the `mat-icon` component. Fixes #8594
Add unit tests for setting the mat-icon[color] attribute on a menu item
Related to #8594
src/lib/menu/menu.spec.ts
Outdated
@@ -223,6 +225,32 @@ describe('MatMenu', () => { | |||
expect(fixture.componentInstance.items.first.getLabel()).toBe('Item'); | |||
}); | |||
|
|||
it('should have an icon with the default theme color if mat-icon has no color attribute set', |
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 get rid of these tests since they're basically testing the CSS engine.
src/lib/menu/menu.spec.ts
Outdated
@@ -44,7 +45,7 @@ describe('MatMenu', () => { | |||
beforeEach(async(() => { | |||
dir = 'ltr'; | |||
TestBed.configureTestingModule({ | |||
imports: [MatMenuModule, NoopAnimationsModule], | |||
imports: [MatIconModule, MatMenuModule, NoopAnimationsModule], |
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.
In general we try to avoid having dependencies between components like this. It shouldn't be an issue after the previous comment about removing the tests is addressed.
@crisbeto Comments have been addressed |
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
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. |
Set the theme icon color only if the
color
input property was not set on themat-icon
component.Fixes #8594