From 1daa8bcef7b737ee8a7876414fe1f0b5eef01ce2 Mon Sep 17 00:00:00 2001 From: Jeremy Elbourn Date: Fri, 7 Aug 2015 15:22:55 -0700 Subject: [PATCH] fix(icon): don't guard adding icon class on presence of class attr. --- src/components/icon/iconDirective.js | 2 +- src/components/icon/iconDirective.spec.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/icon/iconDirective.js b/src/components/icon/iconDirective.js index 5dabd5e6178..fff129ef492 100644 --- a/src/components/icon/iconDirective.js +++ b/src/components/icon/iconDirective.js @@ -255,7 +255,7 @@ function mdIconDirective($mdIcon, $mdTheming, $mdAria ) { } function shouldUseDefaultFontSet() { - return !scope.fontIcon && !scope.fontSet && !attr.hasOwnProperty('class'); + return !scope.fontIcon && !scope.fontSet; } } } diff --git a/src/components/icon/iconDirective.spec.js b/src/components/icon/iconDirective.spec.js index 92843a32af6..ee8a70586f3 100644 --- a/src/components/icon/iconDirective.spec.js +++ b/src/components/icon/iconDirective.spec.js @@ -66,7 +66,7 @@ describe('mdIcon directive', function() { expect(el.attr('md-font-icon')).toBe($scope.font.name); expect(el.hasClass('step')).toBe(true); - expect(el.hasClass('material-icons')).toBe(false); + expect(el.hasClass('material-icons')).toBe(true); expect(el.attr('aria-label')).toBe($scope.font.name + $scope.font.size); expect(el.attr('role')).toBe('img'); }) @@ -79,7 +79,7 @@ describe('mdIcon directive', function() { el = make( 'face'); expect(el.text()).toEqual('face'); - expect(el.hasClass('material-icons')).toBeFalsy(); + expect(el.hasClass('material-icons')).toBeTruthy(); expect(el.hasClass('md-48')).toBeTruthy(); }); @@ -124,7 +124,7 @@ describe('mdIcon directive', function() { el = make( ''); expect(el.text()).toEqual(''); - expect(el.hasClass('material-icons')).toBeFalsy(); + expect(el.hasClass('material-icons')).toBeTruthy(); expect(el.hasClass('custom-cake')).toBeTruthy(); });