Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(icon): don't guard adding icon class on presence of class attr.
Browse files Browse the repository at this point in the history
  • Loading branch information
jelbourn committed Aug 7, 2015
1 parent 6021f94 commit 1daa8bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/icon/iconDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ function mdIconDirective($mdIcon, $mdTheming, $mdAria ) {
}

function shouldUseDefaultFontSet() {
return !scope.fontIcon && !scope.fontSet && !attr.hasOwnProperty('class');
return !scope.fontIcon && !scope.fontSet;
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/icon/iconDirective.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
})
Expand All @@ -79,7 +79,7 @@ describe('mdIcon directive', function() {
el = make( '<md-icon class="md-48">face</md-icon>');

expect(el.text()).toEqual('face');
expect(el.hasClass('material-icons')).toBeFalsy();
expect(el.hasClass('material-icons')).toBeTruthy();
expect(el.hasClass('md-48')).toBeTruthy();
});

Expand Down Expand Up @@ -124,7 +124,7 @@ describe('mdIcon directive', function() {
el = make( '<md-icon class="custom-cake"></md-icon>');

expect(el.text()).toEqual('');
expect(el.hasClass('material-icons')).toBeFalsy();
expect(el.hasClass('material-icons')).toBeTruthy();
expect(el.hasClass('custom-cake')).toBeTruthy();
});

Expand Down

0 comments on commit 1daa8bc

Please sign in to comment.