Skip to content
This repository was archived by the owner on Feb 10, 2023. It is now read-only.

Commit ceeae2e

Browse files
committed
fix(init-error): Solve first run error
fixes #21
1 parent 67eaa72 commit ceeae2e

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

test/e2e/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"noEmitOnError": true
99
},
1010
"exclude": [
11+
"../../node_modules",
1112
"node_modules",
1213
"platforms",
1314
"**/*.aot.ts"

test/spec/urlhandler.android.spec.js

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
11
import './mocks/general.mock';
22
import {
3-
handleOpenURL
3+
handleOpenURL,
4+
handleIntent
45
} from '../../urlhandler.android';
56

67
describe('Android', function() {
7-
it('handleOpenURL', function() {
8+
9+
describe('handleOpenURL', function() {
10+
11+
it('function should be defined', function() {
812
expect(handleOpenURL).toBeDefined();
913
});
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+
});

urlhandler.android.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let lastReceivedData = null;
77

88
export function handleIntent(intent: any) {
99
let data = intent.getData();
10-
if (data.toString() !== lastReceivedData.toString()) {
10+
if (lastReceivedData === null || data.toString() !== lastReceivedData.toString()) {
1111
try {
1212
if (new String(intent.getAction()).valueOf() === new String(android.content.Intent.ACTION_VIEW).valueOf()) {
1313
application.android.on(application.AndroidApplication.activityResultEvent, (eventData) => {

0 commit comments

Comments
 (0)