11// make sure you import mocha-config before @angular/core
22import { Component , inject , NgModule , NO_ERRORS_SCHEMA , ViewContainerRef } from '@angular/core' ;
33import { TestBed , waitForAsync } from '@angular/core/testing' ;
4- import { FrameService , ModalDialogParams , ModalDialogService , NSLocationStrategy , Outlet } from '@nativescript/angular' ;
4+ import { FrameService , ModalDialogParams , ModalDialogService , NativeScriptCommonModule , NSLocationStrategy , Outlet } from '@nativescript/angular' ;
55import { Frame , isIOS } from '@nativescript/core' ;
66
77import { FakeFrameService } from './ns-location-strategy.spec' ;
@@ -10,6 +10,7 @@ const CLOSE_WAIT = isIOS ? 1000 : 0;
1010@Component ( {
1111 selector : 'modal-comp' ,
1212 template : `<Label text="this is modal component" (shownModally)="onShownModally()"></Label>` ,
13+ imports : [ NativeScriptCommonModule ] ,
1314 schemas : [ NO_ERRORS_SCHEMA ] ,
1415} )
1516export class ModalComponent {
@@ -25,6 +26,7 @@ export class ModalComponent {
2526 selector : 'fail-comp' ,
2627 providers : [ ModalDialogService ] ,
2728 template : `<Label text="This app is doomed"></Label>` ,
29+ imports : [ NativeScriptCommonModule ] ,
2830 schemas : [ NO_ERRORS_SCHEMA ] ,
2931} )
3032export class FailComponent {
@@ -37,6 +39,7 @@ export class FailComponent {
3739 template : ` <GridLayout margin="20">
3840 <Label text="Modal dialogs"></Label>
3941 </GridLayout>` ,
42+ imports : [ NativeScriptCommonModule ] ,
4043 schemas : [ NO_ERRORS_SCHEMA ] ,
4144} )
4245export class SuccessComponent {
@@ -47,9 +50,8 @@ export class SuccessComponent {
4750}
4851
4952@NgModule ( {
50- imports : [ FailComponent , SuccessComponent , ModalComponent ] ,
53+ imports : [ FailComponent , SuccessComponent , ModalComponent , NativeScriptCommonModule ] ,
5154 exports : [ FailComponent , SuccessComponent , ModalComponent ] ,
52- // entryComponents: [ModalComponent],
5355 schemas : [ NO_ERRORS_SCHEMA ] ,
5456} )
5557export class EntryComponentsTestModule { }
@@ -62,7 +64,7 @@ describe('modal-dialog', () => {
6264 // [ModalComponent]));
6365 beforeEach ( ( ) => {
6466 return TestBed . configureTestingModule ( {
65- imports : [ FailComponent , SuccessComponent , ModalComponent ] ,
67+ imports : [ FailComponent , SuccessComponent , ModalComponent , NativeScriptCommonModule ] ,
6668 providers : [ { provide : FrameService , useValue : new FakeFrameService ( ) } , NSLocationStrategy ] ,
6769 } ) . compileComponents ( ) ;
6870 } ) ;
0 commit comments