mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
test(button): add test for disabled input attribute
This commit is contained in:
committed by
Hans Larsen
parent
fa6341a465
commit
10d1e75bba
@@ -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();
|
||||
})
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user