File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ import { StatusBar } from '@ionic-native/status-bar';
55import { SplashScreen } from '@ionic-native/splash-screen' ;
66
77import { MyApp } from './app.component' ;
8- import { PlatformMock } from '../../test-config/mocks-ionic' ;
8+ import {
9+ PlatformMock ,
10+ StatusBarMock ,
11+ SplashScreenMock
12+ } from '../../test-config/mocks-ionic' ;
913
1014describe ( 'MyApp Component' , ( ) => {
1115 let fixture ;
@@ -18,8 +22,8 @@ describe('MyApp Component', () => {
1822 IonicModule . forRoot ( MyApp )
1923 ] ,
2024 providers : [
21- StatusBar ,
22- SplashScreen ,
25+ { provide : StatusBar , useClass : StatusBarMock } ,
26+ { provide : SplashScreen , useClass : SplashScreenMock } ,
2327 { provide : Platform , useClass : PlatformMock }
2428 ]
2529 } )
Original file line number Diff line number Diff line change 1+ import { StatusBar } from '@ionic-native/status-bar' ;
2+ import { SplashScreen } from '@ionic-native/splash-screen' ;
3+
14export class PlatformMock {
25 public ready ( ) : Promise < { String } > {
36 return new Promise ( ( resolve ) => {
@@ -62,3 +65,15 @@ export class PlatformMock {
6265 return document [ 'activeElement' ] ;
6366 }
6467}
68+
69+ export class StatusBarMock extends StatusBar {
70+ styleDefault ( ) {
71+ return ;
72+ }
73+ }
74+
75+ export class SplashScreenMock extends SplashScreen {
76+ hide ( ) {
77+ return ;
78+ }
79+ }
You can’t perform that action at this time.
0 commit comments