File tree Expand file tree Collapse file tree 1 file changed +64
-0
lines changed
Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ export class PlatformMock {
2+ public ready ( ) : Promise < { String } > {
3+ return new Promise ( ( resolve ) => {
4+ resolve ( 'READY' ) ;
5+ } ) ;
6+ }
7+
8+ public getQueryParam ( ) {
9+ return true ;
10+ }
11+
12+ public registerBackButtonAction ( fn : Function , priority ?: number ) : Function {
13+ return ( ( ) => true ) ;
14+ }
15+
16+ public hasFocus ( ele : HTMLElement ) : boolean {
17+ return true ;
18+ }
19+
20+ public doc ( ) : HTMLDocument {
21+ return document ;
22+ }
23+
24+ public is ( ) : boolean {
25+ return true ;
26+ }
27+
28+ public getElementComputedStyle ( container : any ) : any {
29+ return {
30+ paddingLeft : '10' ,
31+ paddingTop : '10' ,
32+ paddingRight : '10' ,
33+ paddingBottom : '10' ,
34+ } ;
35+ }
36+
37+ public onResize ( callback : any ) {
38+ return callback ;
39+ }
40+
41+ public registerListener ( ele : any , eventName : string , callback : any ) : Function {
42+ return ( ( ) => true ) ;
43+ }
44+
45+ public win ( ) : Window {
46+ return window ;
47+ }
48+
49+ public raf ( callback : any ) : number {
50+ return 1 ;
51+ }
52+
53+ public timeout ( callback : any , timer : number ) : any {
54+ return setTimeout ( callback , timer ) ;
55+ }
56+
57+ public cancelTimeout ( id : any ) {
58+ // do nothing
59+ }
60+
61+ public getActiveElement ( ) : any {
62+ return document [ 'activeElement' ] ;
63+ }
64+ }
You can’t perform that action at this time.
0 commit comments