I have a simple Ionic2 component using the following directives:
@View({
templateUrl: 'build/components/checkinDateInput/checkinDateInput.html',
directives: [ FocusDirective, Item, Label, TextInput ],
})
When testing this I'm getting an error: No provider for Form! (Item -> Form)
I have tried adding the provider to my spec:
beforeEachProviders(() => [Form]);
However, Form is private in Ionic and as such I don't seem to be able to import it (ionic-framework/util/form.d.ts):
/**
* @private
*/
export declare class Form {
private _blur;
...
error TS2305: Module '".../node_modules/ionic-framework/ionic"' has no exported member 'Form'.
As it can't be imported, I can't mock it out in the beforeEachProviders, because Form would be undefined.
beforeEachProviders(() => [
provide(Form, {useClass: MockForm})
]);
Should I be able to import Form or am I going about this the wrong way?