@@ -9,7 +9,7 @@ import { device, isIOS } from "platform";
9
9
10
10
import { ComponentFixture , async } from "@angular/core/testing" ;
11
11
import { nsTestBedRender , nsTestBedAfterEach , nsTestBedBeforeEach } from "nativescript-angular/testing" ;
12
- import { NSLocationStrategy } from "nativescript-angular/router/ns-location-strategy" ;
12
+ import { NSLocationStrategy , Outlet } from "nativescript-angular/router/ns-location-strategy" ;
13
13
import { FrameService } from "nativescript-angular" ;
14
14
import { FakeFrameService } from "./ns-location-strategy" ;
15
15
const CLOSE_WAIT = isIOS ? 1000 : 0 ;
@@ -47,7 +47,11 @@ export class FailComponent {
47
47
</GridLayout>`
48
48
} )
49
49
export class SuccessComponent {
50
- constructor ( public service : ModalDialogService , public vcRef : ViewContainerRef ) {
50
+ constructor (
51
+ public service : ModalDialogService ,
52
+ public vcRef : ViewContainerRef ,
53
+ public locationStrategy : NSLocationStrategy ,
54
+ public fakeFrameService : FrameService ) {
51
55
}
52
56
}
53
57
@@ -88,6 +92,16 @@ describe("modal-dialog", () => {
88
92
nsTestBedRender ( SuccessComponent )
89
93
. then ( ( fixture : ComponentFixture < SuccessComponent > ) => {
90
94
const service = < ModalDialogService > fixture . componentRef . instance . service ;
95
+ const locStrategy = < NSLocationStrategy > fixture . componentRef . instance . locationStrategy ;
96
+ const outlet = new Outlet ( "primary" , "primary" , 0 ) ;
97
+
98
+ let parentView = fixture . componentRef . instance . vcRef . element . nativeElement ;
99
+ parentView = parentView . page && parentView . page . frame ;
100
+ outlet . frame = parentView ;
101
+ locStrategy . outlets . push ( outlet ) ;
102
+
103
+ locStrategy . pushState ( null , "test" , "/test" , null ) ;
104
+
91
105
const comp = < SuccessComponent > fixture . componentRef . instance ;
92
106
return service . showModal ( ModalComponent , { viewContainerRef : comp . vcRef } ) ;
93
107
} )
@@ -100,6 +114,16 @@ describe("modal-dialog", () => {
100
114
nsTestBedRender ( SuccessComponent )
101
115
. then ( ( fixture : ComponentFixture < SuccessComponent > ) => {
102
116
const service = < ModalDialogService > fixture . componentRef . instance . service ;
117
+ const locStrategy = < NSLocationStrategy > fixture . componentRef . instance . locationStrategy ;
118
+ const outlet = new Outlet ( "primary" , "primary" , 0 ) ;
119
+
120
+ let parentView = fixture . componentRef . instance . vcRef . element . nativeElement ;
121
+ parentView = parentView . page && parentView . page . frame ;
122
+ outlet . frame = parentView ;
123
+ locStrategy . outlets . push ( outlet ) ;
124
+
125
+ locStrategy . pushState ( null , "test" , "/test" , null ) ;
126
+
103
127
const comp = < SuccessComponent > fixture . componentRef . instance ;
104
128
return service . showModal ( ModalComponent , {
105
129
viewContainerRef : comp . vcRef ,
0 commit comments