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

Commit 730dc11

Browse files
committed
test(ngClass): add test for one-time objects in array literal
1 parent 1352e40 commit 730dc11

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/ng/directive/ngClassSpec.js

+14
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,20 @@ describe('ngClass', function() {
532532
})
533533
);
534534

535+
it('should support a one-time mixed literal-array/object variable', inject(function($rootScope, $compile) {
536+
element = $compile('<div ng-class="::[classVar1, classVar2]"></div>')($rootScope);
537+
538+
$rootScope.classVar1 = {orange: true};
539+
$rootScope.$digest();
540+
expect(element).toHaveClass('orange');
541+
542+
$rootScope.classVar1.orange = false;
543+
$rootScope.$digest();
544+
545+
expect(element).not.toHaveClass('orange');
546+
})
547+
);
548+
535549

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

0 commit comments

Comments
 (0)