I have the following code in jasmine:
it('should pass on writing secondvalue in the input', async(() => {
const fixture=TestBed.createComponent(AppComponent);
const app=fixture.debugElement.nativeElement.querySelector("input").getAttribute("value");
expect(app).toContain("firstvalue");
fixture.detectChanges();
expect(app).toContain("secondvalue");
}));
The problem is that as soon as I run the test, the test fails. I expect it to wait because of the detectChanges() but it doesn't.
How do I properly implement: Waiting for the second value input for the input and check if the value will be "secondvalue".
Shouldn't the fixture.detectChanges() act like a even-blocker, for instance that it waits for the input to be triggered when someone starts writing on it?