Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix autocomplete test #7743

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lib/autocomplete/autocomplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,20 +543,20 @@ describe('MatAutocomplete', () => {
}));

it('should disable input in view when disabled programmatically', () => {
const inputUnderline =
fixture.debugElement.query(By.css('.mat-form-field-underline')).nativeElement;
const formFieldElement =
fixture.debugElement.query(By.css('.mat-form-field')).nativeElement;

expect(input.disabled)
.toBe(false, `Expected input to start out enabled in view.`);
expect(inputUnderline.classList.contains('mat-disabled'))
expect(formFieldElement.classList.contains('mat-form-field-disabled'))
.toBe(false, `Expected input underline to start out with normal styles.`);

fixture.componentInstance.stateCtrl.disable();
fixture.detectChanges();

expect(input.disabled)
.toBe(true, `Expected input to be disabled in view when disabled programmatically.`);
expect(inputUnderline.classList.contains('mat-disabled'))
expect(formFieldElement.classList.contains('mat-form-field-disabled'))
.toBe(true, `Expected input underline to display disabled styles.`);
});

Expand Down