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

Commit

Permalink
fixup! fix($compile): fix ng-prop-* with undefined values
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedard committed Dec 30, 2018
1 parent 6965611 commit 8b9cb92
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/ng/ngPropSpec.js
Expand Up @@ -75,6 +75,22 @@ describe('ngProp*', function() {
expect(element.prop('text')).toBe(null);
}));

it('should directly map special properties (class)', inject(function($rootScope, $compile) {
var element = $compile('<span ng-prop-class="myText" />')($rootScope);
$rootScope.myText = 'abc';
$rootScope.$digest();
expect(element[0].class).toBe('abc');
expect(element).not.toHaveClass('abc');
}));

it('should not use jQuery .prop() to avoid jQuery propFix/hooks', inject(function($rootScope, $compile) {
var element = $compile('<span ng-prop-class="myText" />')($rootScope);
spyOn(jqLite.prototype, 'prop');
$rootScope.myText = 'abc';
$rootScope.$digest();
expect(jqLite.prototype.prop).not.toHaveBeenCalled();
}));

it('should support mixed case using underscore-separated names', inject(function($rootScope, $compile) {
var element = $compile('<span ng-prop-a_bcd_e="value" />')($rootScope);
$rootScope.value = 123;
Expand Down

0 comments on commit 8b9cb92

Please sign in to comment.