test(button): add test for disabled input attribute

This commit is contained in:
Paul Gschwendtner
2016-01-16 12:13:15 +01:00
committed by Hans Larsen
parent fa6341a465
commit 10d1e75bba
+15
View File
@@ -34,6 +34,21 @@ describe('MdButton', () => {
});
});
it('should not increment if disabled', (done: () => void) => {
return builder.createAsync(TestApp).then((fixture) => {
let testComponent = fixture.debugElement.componentInstance;
let buttonDebugElement = fixture.debugElement.query(By.css('button'));
testComponent.isDisabled = true;
fixture.detectChanges();
buttonDebugElement.nativeElement.click();
expect(testComponent.clickCount).toBe(0);
done();
})
});
});
});