This repository was archived by the owner on Feb 10, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +24
-4
lines changed Expand file tree Collapse file tree 3 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 8
8
"noEmitOnError" : true
9
9
},
10
10
"exclude" : [
11
+ " ../../node_modules" ,
11
12
" node_modules" ,
12
13
" platforms" ,
13
14
" **/*.aot.ts"
Original file line number Diff line number Diff line change 1
1
import './mocks/general.mock' ;
2
2
import {
3
- handleOpenURL
3
+ handleOpenURL ,
4
+ handleIntent
4
5
} from '../../urlhandler.android' ;
5
6
6
7
describe ( 'Android' , function ( ) {
7
- it ( 'handleOpenURL' , function ( ) {
8
+
9
+ describe ( 'handleOpenURL' , function ( ) {
10
+
11
+ it ( 'function should be defined' , function ( ) {
8
12
expect ( handleOpenURL ) . toBeDefined ( ) ;
9
13
} ) ;
10
- } ) ;
14
+
15
+ } ) ;
16
+
17
+ describe ( 'handleIntent' , function ( ) {
18
+
19
+ it ( 'function should be defined' , function ( ) {
20
+ expect ( handleOpenURL ) . toBeDefined ( ) ;
21
+ } ) ;
22
+
23
+ it ( 'should handle empty data' , function ( ) {
24
+ handleIntent ( { getData :( ) => '' } ) ;
25
+ } ) ;
26
+
27
+ } ) ;
28
+
29
+ } ) ;
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ let lastReceivedData = null;
7
7
8
8
export function handleIntent ( intent : any ) {
9
9
let data = intent . getData ( ) ;
10
- if ( data . toString ( ) !== lastReceivedData . toString ( ) ) {
10
+ if ( lastReceivedData === null || data . toString ( ) !== lastReceivedData . toString ( ) ) {
11
11
try {
12
12
if ( new String ( intent . getAction ( ) ) . valueOf ( ) === new String ( android . content . Intent . ACTION_VIEW ) . valueOf ( ) ) {
13
13
application . android . on ( application . AndroidApplication . activityResultEvent , ( eventData ) => {
You can’t perform that action at this time.
0 commit comments