Skip to content

Commit ba78acd

Browse files
crisbetojelbourn
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 edf819e commit ba78acd

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
@@ -1759,6 +1759,7 @@ describe('MatSelect', () => {
17591759
fixture.componentInstance.select.open();
17601760
fixture.detectChanges();
17611761
flush();
1762+
fixture.detectChanges();
17621763

17631764
host = fixture.debugElement.query(By.css('mat-select')).nativeElement;
17641765
panel = overlayContainerElement.querySelector('.mat-select-panel')! as HTMLElement;
@@ -4172,7 +4173,7 @@ class BasicSelect {
41724173
panelClass = ['custom-one', 'custom-two'];
41734174
disableRipple: boolean;
41744175

4175-
@ViewChild(MatSelect) select: MatSelect;
4176+
@ViewChild(MatSelect, {static: true}) select: MatSelect;
41764177
@ViewChildren(MatOption) options: QueryList<MatOption>;
41774178
}
41784179

@@ -4326,7 +4327,7 @@ class CustomSelectAccessor implements ControlValueAccessor {
43264327
})
43274328
class CompWithCustomSelect {
43284329
ctrl = new FormControl('initial value');
4329-
@ViewChild(CustomSelectAccessor) customAccessor: CustomSelectAccessor;
4330+
@ViewChild(CustomSelectAccessor, {static: true}) customAccessor: CustomSelectAccessor;
43304331
}
43314332

43324333
@Component({

0 commit comments

Comments
 (0)