diff --git a/modules/angular2/test/directives/class_spec.ts b/modules/angular2/test/directives/class_spec.ts index 9cb281d676..f616d034fc 100644 --- a/modules/angular2/test/directives/class_spec.ts +++ b/modules/angular2/test/directives/class_spec.ts @@ -226,6 +226,27 @@ export function main() { async.done(); }); })); + + + it('should remove active classes when switching from string to null', + inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => { + var template = `
`; + + tcb.overrideTemplate(TestComponent, template) + .createAsync(TestComponent) + .then((rootTC) => { + rootTC.detectChanges(); + expect(rootTC.componentViewChildren[0].nativeElement.className) + .toEqual('ng-binding foo'); + + rootTC.componentInstance.strExpr = null; + rootTC.detectChanges(); + expect(rootTC.componentViewChildren[0].nativeElement.className) + .toEqual('ng-binding'); + + async.done(); + }); + })); }); it('should remove active classes when expression evaluates to null',