Skip to content

Commit 10d1e75

Browse files
devversionhansl
authored andcommitted
test(button): add test for disabled input attribute
1 parent fa6341a commit 10d1e75

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/components/button/button.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,21 @@ describe('MdButton', () => {
3434
});
3535
});
3636

37+
it('should not increment if disabled', (done: () => void) => {
38+
return builder.createAsync(TestApp).then((fixture) => {
39+
let testComponent = fixture.debugElement.componentInstance;
40+
let buttonDebugElement = fixture.debugElement.query(By.css('button'));
41+
42+
testComponent.isDisabled = true;
43+
fixture.detectChanges();
44+
45+
buttonDebugElement.nativeElement.click();
46+
47+
expect(testComponent.clickCount).toBe(0);
48+
done();
49+
})
50+
});
51+
3752
});
3853
});
3954

0 commit comments

Comments
 (0)