Skip to content

Commit

Permalink
test(ngClass): add test for one-time objects in array literal
Browse files Browse the repository at this point in the history
  • Loading branch information
jbedard committed Jul 17, 2017
1 parent 2ee5033 commit 2fb2d09
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/ng/directive/ngClassSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,20 @@ describe('ngClass', function() {
})
);

it('should support a one-time mixed literal-array/object variable', inject(function($rootScope, $compile) {
element = $compile('<div ng-class="::[classVar1, classVar2]"></div>')($rootScope);

$rootScope.classVar1 = {orange: true};
$rootScope.$digest();
expect(element).toHaveClass('orange');

$rootScope.classVar1.orange = false;
$rootScope.$digest();

expect(element).not.toHaveClass('orange');
})
);


it('should do value stabilization as expected when one-time binding',
inject(function($rootScope, $compile) {
Expand Down

0 comments on commit 2fb2d09

Please sign in to comment.