Skip to content

Commit b811cbe

Browse files
crisbetojosephperrott
authored andcommitted
test(select): update static query tests (#15320)
Fixes some tests that will fail under Ivy, because they depend on static queries.
1 parent c1452af commit b811cbe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib/select/select.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,6 +1818,7 @@ describe('MatSelect', () => {
18181818
fixture.componentInstance.select.open();
18191819
fixture.detectChanges();
18201820
flush();
1821+
fixture.detectChanges();
18211822

18221823
host = fixture.debugElement.query(By.css('mat-select')).nativeElement;
18231824
panel = overlayContainerElement.querySelector('.mat-select-panel')! as HTMLElement;
@@ -4232,7 +4233,7 @@ class BasicSelect {
42324233
panelClass = ['custom-one', 'custom-two'];
42334234
disableRipple: boolean;
42344235

4235-
@ViewChild(MatSelect) select: MatSelect;
4236+
@ViewChild(MatSelect, {static: true}) select: MatSelect;
42364237
@ViewChildren(MatOption) options: QueryList<MatOption>;
42374238
}
42384239

@@ -4386,7 +4387,7 @@ class CustomSelectAccessor implements ControlValueAccessor {
43864387
})
43874388
class CompWithCustomSelect {
43884389
ctrl = new FormControl('initial value');
4389-
@ViewChild(CustomSelectAccessor) customAccessor: CustomSelectAccessor;
4390+
@ViewChild(CustomSelectAccessor, {static: true}) customAccessor: CustomSelectAccessor;
43904391
}
43914392

43924393
@Component({

0 commit comments

Comments
 (0)