Skip to content

Commit 4476218

Browse files
committed
add test
1 parent ce16234 commit 4476218

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib/checkbox/checkbox.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,7 @@ describe('MdCheckbox', () => {
710710
let checkboxDebugElement: DebugElement;
711711
let checkboxInstance: MdCheckbox;
712712
let testComponent: CheckboxWithFormControl;
713+
let inputElement: HTMLInputElement;
713714

714715
beforeEach(() => {
715716
fixture = TestBed.createComponent(CheckboxWithFormControl);
@@ -718,6 +719,7 @@ describe('MdCheckbox', () => {
718719
checkboxDebugElement = fixture.debugElement.query(By.directive(MdCheckbox));
719720
checkboxInstance = checkboxDebugElement.componentInstance;
720721
testComponent = fixture.debugElement.componentInstance;
722+
inputElement = <HTMLInputElement>checkboxDebugElement.nativeElement.querySelector('input');
721723
});
722724

723725
it('should toggle the disabled state', () => {
@@ -727,11 +729,13 @@ describe('MdCheckbox', () => {
727729
fixture.detectChanges();
728730

729731
expect(checkboxInstance.disabled).toBe(true);
732+
expect(inputElement.disabled).toBe(true);
730733

731734
testComponent.formControl.enable();
732735
fixture.detectChanges();
733736

734737
expect(checkboxInstance.disabled).toBe(false);
738+
expect(inputElement.disabled).toBe(false);
735739
});
736740
});
737741
});

0 commit comments

Comments
 (0)