MCPcopy Create free account
hub / github.com/angular/components / selectFirstOption

Function selectFirstOption

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

Source from the content-addressed store, hash-verified

2096 let spy = jasmine.createSpy('option selection spy');
2097 let subscription = fixture.componentInstance.select.optionSelectionChanges.subscribe(spy);
2098 let selectFirstOption = async () => {
2099 trigger.click();
2100 fixture.detectChanges();
2101 await fixture.whenRenderingDone();
2102
2103 const option = getOverlayHost(fixture)?.querySelector('mat-option') as HTMLElement;
2104 option.click();
2105 fixture.detectChanges();
2106 await fixture.whenRenderingDone();
2107 };
2108
2109 fixture.componentInstance.foods = [{value: 'salad-8', viewValue: 'Salad'}];
2110 fixture.changeDetectorRef.markForCheck();

Callers 1

select.spec.tsFile · 0.85

Calls 2

getOverlayHostFunction · 0.70
clickMethod · 0.65

Tested by

no test coverage detected