Problem
I have a container component that uses a custom input component. It works fine while serving or after building, but, it doesn't work on tests.
This is the error I'm getting:
Error: No value accessor for form control with name: 'name'
Here is a simplified version of my files:
Template
<app-modal>
<form [formGroup]="myForm" novalidate>
<app-input formControlName="name"></app-input>
</form>
</app-modal>
Test
@Component({ selector: 'app-input', template: '' })
class InputStubComponent {}
beforeEach(async(() => {
TestBed.configureTestingModule({
schemas: [ NO_ERRORS_SCHEMA ],
declarations: [
InputStubComponent
],
imports: [
ReactiveFormsModule,
]
})
.compileComponents();
}));
I've also tried: using CUSTOM_ELEMENTS_SCHEMA and not declaring the component.