Skip to content

Commit b0680ec

Browse files
committed
test(input): Add test for #7086
1 parent d5b4659 commit b0680ec

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

projects/igniteui-angular/src/lib/directives/input/input.directive.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,18 @@ describe('IgxInput', () => {
494494
expect(igxInput.valid).toBe(IgxInputState.INITIAL);
495495
}));
496496

497+
it('should correctly update enabled/disabled state of igxInput when changed via reactive form', fakeAsync(() => {
498+
const fixture = TestBed.createComponent(ReactiveFormComponent);
499+
fixture.detectChanges();
500+
const igxInput = fixture.componentInstance.strIgxInput;
501+
502+
fixture.componentInstance.form.disable();
503+
expect(igxInput.disabled).toBe(true);
504+
505+
fixture.componentInstance.form.get('str').enable();
506+
expect(igxInput.disabled).toBe(false);
507+
}));
508+
497509
it('should style input when required is toggled dynamically.', () => {
498510
const fixture = TestBed.createComponent(ToggleRequiredWithNgModelInputComponent);
499511
fixture.detectChanges();

0 commit comments

Comments
 (0)