Angular Click Select Option In Component Test
Answer : The way to change the selected option of a dropdown is to set the dropdown value and then dispatch a change event. You can use this answer as reference: Angular unit test select onChange spy on empty value In your case, you should do something like this: const select: HTMLSelectElement = fixture.debugElement.query(By.css('#dropdown')).nativeElement; select.value = select.options[3].value; // <-- select a new value select.dispatchEvent(new Event('change')); fixture.detectChanges(); You don't have to dispatch a change event. First you need to click on the trigger for your dropdown, i'm assuming it's your selectEl selectEl = fixture.debugElement.query(By.css('#dropdown')) . selectEl.click(); fixture.detectChanges(); After detectChanges your dropdown should be opened. Only after this will you be able to get your options from fixture, because before they where not present in your fixture. The only way I have been a...