MCPcopy Index your code
hub / github.com/angular/components / selectFirstOption

Function selectFirstOption

src/material/select/select.spec.ts:2018–2027  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2016 let spy = jasmine.createSpy('option selection spy');
2017 let subscription = fixture.componentInstance.select.optionSelectionChanges.subscribe(spy);
2018 let selectFirstOption = async () => {
2019 trigger.click();
2020 fixture.detectChanges();
2021 await fixture.whenRenderingDone();
2022
2023 const option = getOverlayHost(fixture)?.querySelector('mat-option') as HTMLElement;
2024 option.click();
2025 fixture.detectChanges();
2026 await fixture.whenRenderingDone();
2027 };
2028
2029 fixture.componentInstance.foods = [{value: 'salad-8', viewValue: 'Salad'}];
2030 fixture.changeDetectorRef.markForCheck();

Callers 1

select.spec.tsFile · 0.85

Calls 2

getOverlayHostFunction · 0.70
clickMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…