Unit test for Button with disable : <p>I am trying to write a unit test for a button that has disabled assigned to a boolean. </p>

<p>html looks like: </p>

<pre><code>&lt;button *ngIf="!data" id="createBtn" mat-button color="primary" (click)="submitNewCase()" [disabled]="disableCreate"&gt;{{ 'ACTIONS.create' | translate }}&lt;/button&gt;
</code></pre>

<p>my unit test:</p>

<pre><code>beforeEach(() =&gt; {
 fixture = TestBed.createComponent(CaseComponent);
 component = fixture.componentInstance;
 fixture.detectChanges();
 submitEl = fixture.debugElement.query(By.css('button'));
});


  it('DisableCreate set to true disables the submit button', () =&gt; {
   component.disableCreate = true;
   fixture.detectChanges();
   expect(submitEl.nativeElement.disabled).toBeTruthy();
  });

  it('DisableCreate set to false enables the submit button', () =&gt; {
   component.disableCreate = false;
   fixture.detectChanges();
   expect(submitEl.nativeElement.disabled).toBeFalsy();
  });
</code></pre>

<p>My second unit test succeeds and my first one does not. I am getting back a "Expected false to be truthy.". I cannot find where this is failing and why.</p>

<p>Any help would be much appreciated.</p>
