From 67154e096857498775ab3e93fefcab13343d283a Mon Sep 17 00:00:00 2001 From: Kyrylo Onufriiev Date: Wed, 31 Jan 2018 15:31:12 +0200 Subject: [PATCH 1/2] add browser --- lib/public/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/public/script.js b/lib/public/script.js index 5142adf..a97cef7 100644 --- a/lib/public/script.js +++ b/lib/public/script.js @@ -24,7 +24,7 @@ function deepLink(options) { androidPackageName + ';end;', playStoreLink: playStoreLink, - fallback: fallback + fallback: fallback + path }; var isMobile = { From f23a5e7f41a98dc67f557c06bc4b8323a8a9045f Mon Sep 17 00:00:00 2001 From: Kyrylo Onufriiev Date: Wed, 31 Jan 2018 15:42:35 +0200 Subject: [PATCH 2/2] fix tests --- lib/public/script.js | 2 +- test/test.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/public/script.js b/lib/public/script.js index a97cef7..5e550ee 100644 --- a/lib/public/script.js +++ b/lib/public/script.js @@ -24,7 +24,7 @@ function deepLink(options) { androidPackageName + ';end;', playStoreLink: playStoreLink, - fallback: fallback + path + fallback: fallback + '/' + path }; var isMobile = { diff --git a/test/test.js b/test/test.js index 62e0f41..f91c54f 100644 --- a/test/test.js +++ b/test/test.js @@ -3,6 +3,7 @@ const device = require('./lib/device'); const Browser = require('./lib/browser'); const url = 'app://test/'; +const path = url.split(/:\/\/(.+)/)[1]; const fallback = 'https://vandelay.com/'; const androidPackageName = 'ind.vandelay.art'; const iosStoreLink = @@ -43,7 +44,8 @@ describe('android', () => { fallback: fallback }, res => { - assert.equal(res, fallback); + console.log(res); + assert.equal(res, fallback + '/' + path); done(); } ); @@ -82,7 +84,7 @@ describe('ios', () => { fallback: fallback }, res => { - assert.equal(res, fallback); + assert.equal(res, fallback + '/' + path); done(); } ); @@ -109,7 +111,7 @@ describe('general', () => { android_package_name: androidPackageName }, res => { - assert.equal(res, fallback); + assert.equal(res, fallback + '/' + path); done(); } );