@@ -6,6 +6,9 @@ import {Page} from "ui/page";
6
6
import { topmost } from "ui/frame" ;
7
7
import { ModalDialogHost , ModalDialogOptions , ModalDialogParams , ModalDialogService } from "nativescript-angular/directives/dialogs" ;
8
8
9
+ import { device , platformNames } from "platform" ;
10
+ const CLOSE_WAIT = ( device . os === platformNames . ios ) ? 1000 : 0 ;
11
+
9
12
@Component ( {
10
13
selector : "modal-comp" ,
11
14
template : `<Label text="this is modal component"></Label>`
@@ -47,9 +50,13 @@ export class SuccessComponent {
47
50
describe ( 'modal-dialog' , ( ) => {
48
51
let testApp : TestApp = null ;
49
52
50
- before ( ( ) => {
53
+ before ( ( done ) => {
51
54
return TestApp . create ( ) . then ( ( app ) => {
52
55
testApp = app ;
56
+
57
+ // HACK: Wait for the navigations from the test runner app
58
+ // Remove the setTimeout when test runner start tests on page.navigatedTo
59
+ setTimeout ( done , 1000 ) ;
53
60
} )
54
61
} ) ;
55
62
@@ -83,7 +90,7 @@ describe('modal-dialog', () => {
83
90
var service = < ModalDialogService > ref . instance . service ;
84
91
return service . showModal ( ModalComponent , { } ) ;
85
92
} )
86
- . then ( ( res ) => done ( ) )
93
+ . then ( ( res ) => setTimeout ( done , CLOSE_WAIT ) ) // wait for the dialog to close in IOS
87
94
. catch ( done )
88
95
} ) ;
89
96
@@ -97,7 +104,7 @@ describe('modal-dialog', () => {
97
104
} )
98
105
. then ( ( res ) => {
99
106
assert . strictEqual ( res , context ) ;
100
- done ( ) ;
107
+ setTimeout ( done , CLOSE_WAIT ) // wait for the dialog to close in IOS
101
108
} )
102
109
. catch ( done ) ;
103
110
} )
0 commit comments