I have two radio buttons, first one checked. Now, in my test file, I want to check the second radio button and then continue testing further. I am not finding a way to do so.
Following is my radio button:
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="RadioButton" (change)="some_func(true)" checked>
<label class="form-check-label" for="inlineRadio1">Radio1</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="RadioButton" (change)="some_func(false)">
<label class="form-check-label" for="inlineRadio2">Radio2</label>
</div>
I tried the following to change my radio button value, but it doesn't work :
let options: DebugElement[] = fixture.debugElement.queryAll(By.css('input[type="radio"]'));
options[1].triggerEventHandler('change', { target: options[1].nativeElement });
Can someone help me here, how can I make the second radio button checked?