@funnelsgrove/payments 0.11.21 → 0.11.22
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.
|
@@ -303,14 +303,15 @@ export function StripeCheckoutExpressCheckoutButton({ beforeConfirm, checkoutAna
|
|
|
303
303
|
}
|
|
304
304
|
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
305
305
|
};
|
|
306
|
-
|
|
306
|
+
const inertWhileUpdating = (serverUpdatePending ? { inert: true } : {});
|
|
307
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", Object.assign({}, inertWhileUpdating, { "aria-busy": serverUpdatePending || undefined, "aria-disabled": serverUpdatePending || undefined, className: [
|
|
307
308
|
'stripe-express-checkout-button',
|
|
308
309
|
className !== null && className !== void 0 ? className : '',
|
|
309
310
|
effectiveWalletAvailable === false ? 'is-hidden' : '',
|
|
310
311
|
serverUpdatePending ? 'is-server-update-pending' : '',
|
|
311
312
|
]
|
|
312
313
|
.filter(Boolean)
|
|
313
|
-
.join(' '),
|
|
314
|
+
.join(' '), children: _jsx(ExpressCheckoutElementWithCancel, { options: resolvedOptions, onCancel: handleCancel, onClick: handleClick, onConfirm: (event) => void handleConfirm(event), onLoadError: ({ error }) => {
|
|
314
315
|
setWalletAvailable(false);
|
|
315
316
|
onAvailabilityChange === null || onAvailabilityChange === void 0 ? void 0 : onAvailabilityChange(false);
|
|
316
317
|
reportFailure(error.message || 'Unable to load wallet checkout.', 'wallet_load');
|
|
@@ -322,7 +323,7 @@ export function StripeCheckoutExpressCheckoutButton({ beforeConfirm, checkoutAna
|
|
|
322
323
|
if (resolvedAvailable) {
|
|
323
324
|
onError === null || onError === void 0 ? void 0 : onError(null);
|
|
324
325
|
}
|
|
325
|
-
} }) }), _jsx("style", { children: stripeExpressCheckoutButtonStyles })] }));
|
|
326
|
+
} }) })), _jsx("style", { children: stripeExpressCheckoutButtonStyles })] }));
|
|
326
327
|
}
|
|
327
328
|
const stripeExpressCheckoutButtonStyles = `
|
|
328
329
|
.stripe-express-checkout-button {
|
|
@@ -12,6 +12,7 @@ export type WalletCheckoutSmokeProfile = {
|
|
|
12
12
|
};
|
|
13
13
|
export type WalletCheckoutSmokeSnapshot = {
|
|
14
14
|
blockingOverlayVisible: boolean;
|
|
15
|
+
cardDialogVisible: boolean;
|
|
15
16
|
cardFallbackVisible: boolean;
|
|
16
17
|
subscriptionRequestSucceeded: boolean;
|
|
17
18
|
walletSlotState: 'ready' | 'unavailable' | 'unknown';
|
|
@@ -22,6 +23,7 @@ export type WalletCheckoutSmokeEvaluation = {
|
|
|
22
23
|
};
|
|
23
24
|
export type WalletCheckoutSmokeSelectors = {
|
|
24
25
|
blockingOverlay?: string;
|
|
26
|
+
cardDialog: string;
|
|
25
27
|
cardFallback: string;
|
|
26
28
|
walletSlot: string;
|
|
27
29
|
};
|
|
@@ -57,6 +57,9 @@ export function evaluateWalletCheckoutSmokeSnapshot(snapshot) {
|
|
|
57
57
|
if (!snapshot.cardFallbackVisible) {
|
|
58
58
|
failures.push('card fallback checkout is not visible');
|
|
59
59
|
}
|
|
60
|
+
if (!snapshot.cardDialogVisible) {
|
|
61
|
+
failures.push('card checkout dialog did not open');
|
|
62
|
+
}
|
|
60
63
|
if (snapshot.blockingOverlayVisible) {
|
|
61
64
|
failures.push('a blocking loader or modal is still visible');
|
|
62
65
|
}
|
|
@@ -69,7 +72,7 @@ export async function runWalletCheckoutSmokeTest(chromium, options) {
|
|
|
69
72
|
var _a, _b, _c;
|
|
70
73
|
const profiles = (_a = options.profiles) !== null && _a !== void 0 ? _a : buildWalletCheckoutSmokeProfiles();
|
|
71
74
|
const timeoutMs = (_b = options.timeoutMs) !== null && _b !== void 0 ? _b : 15000;
|
|
72
|
-
const subscriptionRequestPath = (_c = options.subscriptionRequestPath) !== null && _c !== void 0 ? _c : '/sdk/public/payments/
|
|
75
|
+
const subscriptionRequestPath = (_c = options.subscriptionRequestPath) !== null && _c !== void 0 ? _c : '/sdk/public/v2/payments/checkout-sessions';
|
|
73
76
|
const browser = await chromium.launch({ headless: true });
|
|
74
77
|
try {
|
|
75
78
|
const results = [];
|
|
@@ -102,20 +105,32 @@ export async function runWalletCheckoutSmokeTest(chromium, options) {
|
|
|
102
105
|
timeout: timeoutMs,
|
|
103
106
|
}).then(() => 'unavailable'),
|
|
104
107
|
]).catch(() => 'unknown');
|
|
108
|
+
const cardFallbackVisible = await page
|
|
109
|
+
.isVisible(options.selectors.cardFallback, { timeout: timeoutMs })
|
|
110
|
+
.catch(() => false);
|
|
111
|
+
if (cardFallbackVisible) {
|
|
112
|
+
await page.click(options.selectors.cardFallback, { timeout: timeoutMs }).catch(() => undefined);
|
|
113
|
+
}
|
|
114
|
+
const cardDialogVisible = cardFallbackVisible
|
|
115
|
+
? await page.waitForSelector(options.selectors.cardDialog, {
|
|
116
|
+
state: 'visible',
|
|
117
|
+
timeout: timeoutMs,
|
|
118
|
+
}).then(() => true).catch(() => false)
|
|
119
|
+
: false;
|
|
120
|
+
const blockingOverlayVisible = options.selectors.blockingOverlay
|
|
121
|
+
? await page.waitForSelector(options.selectors.blockingOverlay, {
|
|
122
|
+
state: 'hidden',
|
|
123
|
+
timeout: timeoutMs,
|
|
124
|
+
}).then(() => false).catch(() => true)
|
|
125
|
+
: false;
|
|
105
126
|
const snapshot = {
|
|
106
|
-
blockingOverlayVisible
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
cardFallbackVisible: await page
|
|
110
|
-
.isVisible(options.selectors.cardFallback, { timeout: timeoutMs })
|
|
111
|
-
.catch(() => false),
|
|
127
|
+
blockingOverlayVisible,
|
|
128
|
+
cardDialogVisible,
|
|
129
|
+
cardFallbackVisible,
|
|
112
130
|
subscriptionRequestSucceeded: await subscriptionResponse,
|
|
113
131
|
walletSlotState: walletSlotResolved,
|
|
114
132
|
};
|
|
115
133
|
const evaluation = evaluateWalletCheckoutSmokeSnapshot(snapshot);
|
|
116
|
-
if (snapshot.cardFallbackVisible) {
|
|
117
|
-
await page.click(options.selectors.cardFallback, { timeout: timeoutMs }).catch(() => undefined);
|
|
118
|
-
}
|
|
119
134
|
results.push(Object.assign(Object.assign({}, evaluation), { profileId: profile.id, snapshot }));
|
|
120
135
|
}
|
|
121
136
|
finally {
|