title: Angular 4 (karma) Test input value to input filed
body: <p>I'm trying to test event which value entering by keyboard. my problem is after set value to the input field, when I print it prints, but when I print it inside the whenStable() it prints empty. I want to know why this value gets reset inside of the Whitstable() function. and how can I fix it?</p>
  
  <p>I have referred: <a href="https://stackoverflow.com/questions/39582707/updating-input-html-field-from-within-an-angular-2-test">Updating input html field from within an Angular 2 test</a> to write this test case.</p>
  
  <pre><code>it('Test input field value. ', async () =&gt; {
      const divDescription = fixture.debugElement.query(By.css('#costDescription'));
  
      divDescription.nativeElement.value = 'text';
      divDescription.nativeElement.dispatchEvent(new Event('input'));
      fixture.detectChanges();
      console.log('sendInput : ', divDescription.nativeElement.value); // prints 'text'
      fixture.whenStable().then(() =&gt; {
        console.log('sendInput : ', divDescription.nativeElement.value); // prints ''
        expect(divDescription.nativeElement.value).toContain('text');
      });
    });
  </code></pre>