Reproduction
I am trying to get the name of a MatInput control which is bound to a component property name as:
<input matInput [name]="name" [(ngModel)]="model">
I am using the getName() method of MatInputHarness as:
const input = await loader.getHarness(MatInputHarness);
expect(await input.getName()).not.toBe('')
but the expectation fails. If I remove the ngModel directive, the test passes successfully.
https://stackblitz.com/edit/components-issue-atwks1
Expected Behavior
The test should pass
Actual Behavior
The test fails
Environment
- Angular: 9.0.2
- CDK/Material: 9.1.0
- Browser(s):
- Operating System (e.g. Windows, macOS, Ubuntu): Windows
Reproduction
I am trying to get the name of a
MatInputcontrol which is bound to a component propertynameas:<input matInput [name]="name" [(ngModel)]="model">I am using the
getName()method ofMatInputHarnessas:but the expectation fails. If I remove the
ngModeldirective, the test passes successfully.https://stackblitz.com/edit/components-issue-atwks1
Expected Behavior
The test should pass
Actual Behavior
The test fails
Environment