@paypal/checkout-components 5.0.385 → 5.0.386
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/button.js +1 -1
- package/dist/test/button.js +1 -1
- package/package.json +1 -2
- package/src/funding/funding.js +4 -17
- package/src/funding/funding.test.js +16 -300
- package/src/funding/venmo/config.jsx +8 -7
- package/src/funding/venmo/config.test.js +37 -17
- package/src/marks/component.jsx +0 -5
- package/src/ui/buttons/buttons.jsx +0 -2
- package/src/ui/buttons/props.js +0 -6
- package/src/zoid/buttons/component.jsx +2 -33
- package/src/funding/util.js +0 -99
- package/src/funding/util.test.js +0 -264
|
@@ -61,7 +61,6 @@ import {
|
|
|
61
61
|
isApplePaySupported,
|
|
62
62
|
supportsPopups as userAgentSupportsPopups,
|
|
63
63
|
noop,
|
|
64
|
-
getUserAgent,
|
|
65
64
|
} from "@krakenjs/belter/src";
|
|
66
65
|
import {
|
|
67
66
|
FUNDING,
|
|
@@ -90,10 +89,6 @@ import {
|
|
|
90
89
|
type ButtonExtensions,
|
|
91
90
|
} from "../../ui/buttons/props";
|
|
92
91
|
import { isFundingEligible } from "../../funding";
|
|
93
|
-
import {
|
|
94
|
-
supportsVenmoPopups,
|
|
95
|
-
isSupportedNativeVenmoBrowser,
|
|
96
|
-
} from "../../funding/util";
|
|
97
92
|
import { getPixelComponent } from "../pixel";
|
|
98
93
|
import { CLASS } from "../../constants";
|
|
99
94
|
import { PayPalAppSwitchOverlay } from "../../ui/overlay/paypal-app-switch/overlay";
|
|
@@ -256,7 +251,6 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
|
|
|
256
251
|
createSubscription,
|
|
257
252
|
createVaultSetupToken,
|
|
258
253
|
displayOnly,
|
|
259
|
-
userAgent,
|
|
260
254
|
} = props;
|
|
261
255
|
|
|
262
256
|
const flow = determineFlow({
|
|
@@ -300,7 +294,6 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
|
|
|
300
294
|
supportedNativeBrowser,
|
|
301
295
|
experiment,
|
|
302
296
|
displayOnly,
|
|
303
|
-
userAgent,
|
|
304
297
|
})
|
|
305
298
|
) {
|
|
306
299
|
return {
|
|
@@ -721,7 +714,6 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
|
|
|
721
714
|
createSubscription,
|
|
722
715
|
createVaultSetupToken,
|
|
723
716
|
displayOnly,
|
|
724
|
-
userAgent = getUserAgent(),
|
|
725
717
|
} = props;
|
|
726
718
|
|
|
727
719
|
const flow = determineFlow({
|
|
@@ -752,7 +744,6 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
|
|
|
752
744
|
supportsPopups,
|
|
753
745
|
supportedNativeBrowser,
|
|
754
746
|
displayOnly,
|
|
755
|
-
userAgent,
|
|
756
747
|
})
|
|
757
748
|
) {
|
|
758
749
|
throw new Error(`${fundingSource} is not eligible`);
|
|
@@ -1275,28 +1266,13 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
|
|
|
1275
1266
|
|
|
1276
1267
|
supportedNativeBrowser: {
|
|
1277
1268
|
type: "boolean",
|
|
1278
|
-
value:
|
|
1279
|
-
if (props.fundingSource === FUNDING.VENMO) {
|
|
1280
|
-
return isSupportedNativeVenmoBrowser(
|
|
1281
|
-
props.experiment,
|
|
1282
|
-
props.userAgent
|
|
1283
|
-
);
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
return isSupportedNativeBrowser();
|
|
1287
|
-
},
|
|
1269
|
+
value: isSupportedNativeBrowser,
|
|
1288
1270
|
queryParam: true,
|
|
1289
1271
|
},
|
|
1290
1272
|
|
|
1291
1273
|
supportsPopups: {
|
|
1292
1274
|
type: "boolean",
|
|
1293
|
-
value: (
|
|
1294
|
-
if (props.fundingSource === FUNDING.VENMO) {
|
|
1295
|
-
return supportsVenmoPopups(props.experiment, props.userAgent);
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
return userAgentSupportsPopups();
|
|
1299
|
-
},
|
|
1275
|
+
value: () => userAgentSupportsPopups(),
|
|
1300
1276
|
queryParam: true,
|
|
1301
1277
|
},
|
|
1302
1278
|
|
|
@@ -1340,13 +1316,6 @@ export const getButtonsComponent: () => ButtonsComponent = memoize(() => {
|
|
|
1340
1316
|
required: false,
|
|
1341
1317
|
queryParam: true,
|
|
1342
1318
|
},
|
|
1343
|
-
|
|
1344
|
-
userAgent: {
|
|
1345
|
-
type: "string",
|
|
1346
|
-
required: false,
|
|
1347
|
-
queryParam: true,
|
|
1348
|
-
value: getUserAgent,
|
|
1349
|
-
},
|
|
1350
1319
|
},
|
|
1351
1320
|
|
|
1352
1321
|
exports: {
|
package/src/funding/util.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/* @flow */
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
isWebView,
|
|
5
|
-
isIosWebview,
|
|
6
|
-
isAndroidWebview,
|
|
7
|
-
isFacebookWebView,
|
|
8
|
-
isOperaMini,
|
|
9
|
-
isFirefoxIOS,
|
|
10
|
-
isEdgeIOS,
|
|
11
|
-
isQQBrowser,
|
|
12
|
-
isElectron,
|
|
13
|
-
supportsPopups,
|
|
14
|
-
isTablet,
|
|
15
|
-
isIos,
|
|
16
|
-
isSafari,
|
|
17
|
-
isAndroid,
|
|
18
|
-
isChrome,
|
|
19
|
-
isFirefox,
|
|
20
|
-
} from "@krakenjs/belter/src";
|
|
21
|
-
|
|
22
|
-
import type { Experiment } from "../types";
|
|
23
|
-
|
|
24
|
-
const isMacOsCna = (userAgent: string): boolean => {
|
|
25
|
-
return /Macintosh.*AppleWebKit(?!.*Safari)/i.test(userAgent);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const isVenmoSupportedWebView = (userAgent: string): boolean => {
|
|
29
|
-
return (
|
|
30
|
-
isWebView(userAgent) ||
|
|
31
|
-
isIosWebview(userAgent) ||
|
|
32
|
-
isAndroidWebview(userAgent) ||
|
|
33
|
-
isFacebookWebView(userAgent)
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const venmoUserAgentSupportsPopups = (userAgent: string): boolean => {
|
|
38
|
-
return !(
|
|
39
|
-
isVenmoSupportedWebView(userAgent) ||
|
|
40
|
-
isOperaMini(userAgent) ||
|
|
41
|
-
isFirefoxIOS(userAgent) ||
|
|
42
|
-
isEdgeIOS(userAgent) ||
|
|
43
|
-
isQQBrowser(userAgent) ||
|
|
44
|
-
isMacOsCna(userAgent) ||
|
|
45
|
-
isElectron()
|
|
46
|
-
);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export function supportsVenmoPopups(
|
|
50
|
-
experiment?: Experiment,
|
|
51
|
-
userAgent: string
|
|
52
|
-
): boolean {
|
|
53
|
-
if (isVenmoSupportedWebView(userAgent)) {
|
|
54
|
-
if (typeof window !== "undefined" && window.popupBridge) {
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (experiment?.venmoEnableWebOnNonNativeBrowser === true) {
|
|
61
|
-
return venmoUserAgentSupportsPopups(userAgent);
|
|
62
|
-
}
|
|
63
|
-
return supportsPopups();
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export function isSupportedNativeVenmoBrowser(
|
|
67
|
-
experiment?: Experiment,
|
|
68
|
-
userAgent: string
|
|
69
|
-
): boolean {
|
|
70
|
-
if (isVenmoSupportedWebView(userAgent)) {
|
|
71
|
-
if (typeof window !== "undefined" && window.popupBridge) {
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (isTablet(userAgent)) {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Default supported browsers for Venmo
|
|
82
|
-
if (
|
|
83
|
-
(isIos(userAgent) && isSafari(userAgent)) ||
|
|
84
|
-
(isAndroid(userAgent) && isChrome(userAgent))
|
|
85
|
-
) {
|
|
86
|
-
return true;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// Additional browsers enabled by experiment
|
|
90
|
-
if (
|
|
91
|
-
experiment?.venmoEnableWebOnNonNativeBrowser === true &&
|
|
92
|
-
((isIos(userAgent) && isChrome(userAgent)) ||
|
|
93
|
-
(isAndroid(userAgent) && isFirefox(userAgent)))
|
|
94
|
-
) {
|
|
95
|
-
return true;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return false;
|
|
99
|
-
}
|
package/src/funding/util.test.js
DELETED
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
/* @flow */
|
|
2
|
-
|
|
3
|
-
import { vi, describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
4
|
-
import {
|
|
5
|
-
isWebView,
|
|
6
|
-
isIosWebview,
|
|
7
|
-
isAndroidWebview,
|
|
8
|
-
isFacebookWebView,
|
|
9
|
-
isOperaMini,
|
|
10
|
-
isFirefoxIOS,
|
|
11
|
-
isEdgeIOS,
|
|
12
|
-
isQQBrowser,
|
|
13
|
-
isElectron,
|
|
14
|
-
supportsPopups,
|
|
15
|
-
isTablet,
|
|
16
|
-
isIos,
|
|
17
|
-
isSafari,
|
|
18
|
-
isAndroid,
|
|
19
|
-
isChrome,
|
|
20
|
-
isFirefox,
|
|
21
|
-
} from "@krakenjs/belter/src";
|
|
22
|
-
|
|
23
|
-
import { supportsVenmoPopups, isSupportedNativeVenmoBrowser } from "./util";
|
|
24
|
-
|
|
25
|
-
// Mock all the browser detection functions from belter
|
|
26
|
-
vi.mock("@krakenjs/belter/src", () => ({
|
|
27
|
-
isWebView: vi.fn(),
|
|
28
|
-
isIosWebview: vi.fn(),
|
|
29
|
-
isAndroidWebview: vi.fn(),
|
|
30
|
-
isFacebookWebView: vi.fn(),
|
|
31
|
-
isOperaMini: vi.fn(),
|
|
32
|
-
isFirefoxIOS: vi.fn(),
|
|
33
|
-
isEdgeIOS: vi.fn(),
|
|
34
|
-
isQQBrowser: vi.fn(),
|
|
35
|
-
isElectron: vi.fn(),
|
|
36
|
-
supportsPopups: vi.fn(),
|
|
37
|
-
isTablet: vi.fn(),
|
|
38
|
-
isIos: vi.fn(),
|
|
39
|
-
isSafari: vi.fn(),
|
|
40
|
-
isAndroid: vi.fn(),
|
|
41
|
-
isChrome: vi.fn(),
|
|
42
|
-
isFirefox: vi.fn(),
|
|
43
|
-
}));
|
|
44
|
-
|
|
45
|
-
describe("funding/util", () => {
|
|
46
|
-
const defaultUserAgent =
|
|
47
|
-
"Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1";
|
|
48
|
-
|
|
49
|
-
beforeEach(() => {
|
|
50
|
-
// Reset all mocks before each test
|
|
51
|
-
vi.clearAllMocks();
|
|
52
|
-
|
|
53
|
-
// Reset window.popupBridge
|
|
54
|
-
delete window.popupBridge;
|
|
55
|
-
|
|
56
|
-
// Set default mock return values
|
|
57
|
-
vi.mocked(isWebView).mockReturnValue(false);
|
|
58
|
-
vi.mocked(isIosWebview).mockReturnValue(false);
|
|
59
|
-
vi.mocked(isAndroidWebview).mockReturnValue(false);
|
|
60
|
-
vi.mocked(isFacebookWebView).mockReturnValue(false);
|
|
61
|
-
vi.mocked(isOperaMini).mockReturnValue(false);
|
|
62
|
-
vi.mocked(isFirefoxIOS).mockReturnValue(false);
|
|
63
|
-
vi.mocked(isEdgeIOS).mockReturnValue(false);
|
|
64
|
-
vi.mocked(isQQBrowser).mockReturnValue(false);
|
|
65
|
-
vi.mocked(isElectron).mockReturnValue(false);
|
|
66
|
-
vi.mocked(supportsPopups).mockReturnValue(true);
|
|
67
|
-
vi.mocked(isTablet).mockReturnValue(false);
|
|
68
|
-
vi.mocked(isIos).mockReturnValue(false);
|
|
69
|
-
vi.mocked(isSafari).mockReturnValue(false);
|
|
70
|
-
vi.mocked(isAndroid).mockReturnValue(false);
|
|
71
|
-
vi.mocked(isChrome).mockReturnValue(false);
|
|
72
|
-
vi.mocked(isFirefox).mockReturnValue(false);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
afterEach(() => {
|
|
76
|
-
vi.resetAllMocks();
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
describe("supportsVenmoPopups", () => {
|
|
80
|
-
describe("when in supported webview", () => {
|
|
81
|
-
beforeEach(() => {
|
|
82
|
-
vi.mocked(isWebView).mockReturnValue(true);
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it("should return true when popupBridge is available", () => {
|
|
86
|
-
window.popupBridge = {};
|
|
87
|
-
|
|
88
|
-
expect(supportsVenmoPopups({}, defaultUserAgent)).toBe(true);
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it("should return false when popupBridge is not available", () => {
|
|
92
|
-
expect(supportsVenmoPopups({}, defaultUserAgent)).toBe(false);
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
describe("when not in supported webview", () => {
|
|
97
|
-
it("should return true when experiment flag is enabled and user agent supports popups", () => {
|
|
98
|
-
vi.mocked(supportsPopups).mockReturnValue(true);
|
|
99
|
-
const experiment = { venmoEnableWebOnNonNativeBrowser: true };
|
|
100
|
-
|
|
101
|
-
expect(supportsVenmoPopups(experiment, defaultUserAgent)).toBe(true);
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
it("should return false when experiment flag is enabled but user agent doesn't support popups due to isOperaMini", () => {
|
|
105
|
-
vi.mocked(isOperaMini).mockReturnValue(true);
|
|
106
|
-
const experiment = { venmoEnableWebOnNonNativeBrowser: true };
|
|
107
|
-
|
|
108
|
-
expect(supportsVenmoPopups(experiment, defaultUserAgent)).toBe(false);
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
it("should return false when experiment flag is enabled but user agent doesn't support popups due to isFirefoxIOS", () => {
|
|
112
|
-
vi.mocked(isFirefoxIOS).mockReturnValue(true);
|
|
113
|
-
const experiment = { venmoEnableWebOnNonNativeBrowser: true };
|
|
114
|
-
|
|
115
|
-
expect(supportsVenmoPopups(experiment, defaultUserAgent)).toBe(false);
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
it("should return false when experiment flag is enabled but user agent doesn't support popups due to isEdgeIOS", () => {
|
|
119
|
-
vi.mocked(isEdgeIOS).mockReturnValue(true);
|
|
120
|
-
const experiment = { venmoEnableWebOnNonNativeBrowser: true };
|
|
121
|
-
|
|
122
|
-
expect(supportsVenmoPopups(experiment, defaultUserAgent)).toBe(false);
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it("should return false when experiment flag is enabled but user agent doesn't support popups due to isQQBrowser", () => {
|
|
126
|
-
vi.mocked(isQQBrowser).mockReturnValue(true);
|
|
127
|
-
const experiment = { venmoEnableWebOnNonNativeBrowser: true };
|
|
128
|
-
|
|
129
|
-
expect(supportsVenmoPopups(experiment, defaultUserAgent)).toBe(false);
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
it("should return false when experiment flag is enabled but user agent doesn't support popups due to isElectron", () => {
|
|
133
|
-
vi.mocked(isElectron).mockReturnValue(true);
|
|
134
|
-
const experiment = { venmoEnableWebOnNonNativeBrowser: true };
|
|
135
|
-
|
|
136
|
-
expect(supportsVenmoPopups(experiment, defaultUserAgent)).toBe(false);
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
it("should fall back to supportsPopups when experiment flag is not enabled", () => {
|
|
140
|
-
vi.mocked(supportsPopups).mockReturnValue(true);
|
|
141
|
-
const experiment = {};
|
|
142
|
-
|
|
143
|
-
expect(supportsVenmoPopups(experiment, defaultUserAgent)).toBe(true);
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
it("should fall back to supportsPopups when experiment flag is false", () => {
|
|
147
|
-
vi.mocked(supportsPopups).mockReturnValue(false);
|
|
148
|
-
const experiment = { venmoEnableWebOnNonNativeBrowser: false };
|
|
149
|
-
|
|
150
|
-
expect(supportsVenmoPopups(experiment, defaultUserAgent)).toBe(false);
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
it("should handle undefined experiment", () => {
|
|
154
|
-
vi.mocked(supportsPopups).mockReturnValue(true);
|
|
155
|
-
|
|
156
|
-
expect(supportsVenmoPopups(undefined, defaultUserAgent)).toBe(true);
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
describe("isSupportedNativeVenmoBrowser", () => {
|
|
162
|
-
describe("when in supported webview", () => {
|
|
163
|
-
beforeEach(() => {
|
|
164
|
-
vi.mocked(isWebView).mockReturnValue(true);
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
it("should return true when popupBridge is available", () => {
|
|
168
|
-
window.popupBridge = {};
|
|
169
|
-
|
|
170
|
-
expect(isSupportedNativeVenmoBrowser({}, defaultUserAgent)).toBe(true);
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
it("should return false when popupBridge is not available", () => {
|
|
174
|
-
expect(isSupportedNativeVenmoBrowser({}, defaultUserAgent)).toBe(false);
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
describe("when not in supported webview", () => {
|
|
179
|
-
it("should return false when on tablet", () => {
|
|
180
|
-
vi.mocked(isTablet).mockReturnValue(true);
|
|
181
|
-
|
|
182
|
-
expect(isSupportedNativeVenmoBrowser({}, defaultUserAgent)).toBe(false);
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
it("should return true for iOS Safari by default", () => {
|
|
186
|
-
vi.mocked(isIos).mockReturnValue(true);
|
|
187
|
-
vi.mocked(isSafari).mockReturnValue(true);
|
|
188
|
-
|
|
189
|
-
expect(isSupportedNativeVenmoBrowser({}, defaultUserAgent)).toBe(true);
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
it("should return true for Android Chrome by default", () => {
|
|
193
|
-
vi.mocked(isAndroid).mockReturnValue(true);
|
|
194
|
-
vi.mocked(isChrome).mockReturnValue(true);
|
|
195
|
-
|
|
196
|
-
expect(isSupportedNativeVenmoBrowser({}, defaultUserAgent)).toBe(true);
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
it("should return false for iOS Chrome without experiment flag", () => {
|
|
200
|
-
vi.mocked(isIos).mockReturnValue(true);
|
|
201
|
-
vi.mocked(isChrome).mockReturnValue(true);
|
|
202
|
-
|
|
203
|
-
expect(isSupportedNativeVenmoBrowser({}, defaultUserAgent)).toBe(false);
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
it("should return true for iOS Chrome with experiment flag", () => {
|
|
207
|
-
vi.mocked(isIos).mockReturnValue(true);
|
|
208
|
-
vi.mocked(isChrome).mockReturnValue(true);
|
|
209
|
-
const experiment = { venmoEnableWebOnNonNativeBrowser: true };
|
|
210
|
-
|
|
211
|
-
expect(
|
|
212
|
-
isSupportedNativeVenmoBrowser(experiment, defaultUserAgent)
|
|
213
|
-
).toBe(true);
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
it("should return false for Android Firefox without experiment flag", () => {
|
|
217
|
-
vi.mocked(isAndroid).mockReturnValue(true);
|
|
218
|
-
vi.mocked(isFirefox).mockReturnValue(true);
|
|
219
|
-
|
|
220
|
-
expect(isSupportedNativeVenmoBrowser({}, defaultUserAgent)).toBe(false);
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
it("should return true for Android Firefox with experiment flag", () => {
|
|
224
|
-
vi.mocked(isAndroid).mockReturnValue(true);
|
|
225
|
-
vi.mocked(isFirefox).mockReturnValue(true);
|
|
226
|
-
const experiment = { venmoEnableWebOnNonNativeBrowser: true };
|
|
227
|
-
|
|
228
|
-
expect(
|
|
229
|
-
isSupportedNativeVenmoBrowser(experiment, defaultUserAgent)
|
|
230
|
-
).toBe(true);
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
it("should return false for unsupported browser combinations", () => {
|
|
234
|
-
vi.mocked(isIos).mockReturnValue(true);
|
|
235
|
-
vi.mocked(isFirefox).mockReturnValue(true); // iOS Firefox (not Chrome)
|
|
236
|
-
|
|
237
|
-
expect(isSupportedNativeVenmoBrowser({}, defaultUserAgent)).toBe(false);
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
it("should return false for desktop browsers", () => {
|
|
241
|
-
// No mobile flags set, simulating desktop
|
|
242
|
-
|
|
243
|
-
expect(isSupportedNativeVenmoBrowser({}, defaultUserAgent)).toBe(false);
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
it("should handle undefined experiment", () => {
|
|
247
|
-
vi.mocked(isIos).mockReturnValue(true);
|
|
248
|
-
vi.mocked(isSafari).mockReturnValue(true);
|
|
249
|
-
|
|
250
|
-
expect(isSupportedNativeVenmoBrowser(undefined, defaultUserAgent)).toBe(
|
|
251
|
-
true
|
|
252
|
-
);
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
it("should prioritize tablet check over browser checks", () => {
|
|
256
|
-
vi.mocked(isTablet).mockReturnValue(true);
|
|
257
|
-
vi.mocked(isIos).mockReturnValue(true);
|
|
258
|
-
vi.mocked(isSafari).mockReturnValue(true);
|
|
259
|
-
|
|
260
|
-
expect(isSupportedNativeVenmoBrowser({}, defaultUserAgent)).toBe(false);
|
|
261
|
-
});
|
|
262
|
-
});
|
|
263
|
-
});
|
|
264
|
-
});
|