Skip to content

Commit 49c3dda

Browse files
committed
AdvancedFlowCheckout stories were never receiving the "rest" of the params passed to them
1 parent 4e08542 commit 49c3dda

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/lib/storybook/helpers/create-checkout.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import { createSessionsCheckout } from './create-sessions-checkout';
22
import { createAdvancedFlowCheckout } from './create-advanced-checkout';
3+
import { reject } from '../../src/utils/commonUtils';
34

45
async function createCheckout(context: any): Promise<any> {
5-
const { useSessions, showPayButton, countryCode, shopperLocale, amount } = context.args;
6+
const { useSessions, showPayButton, countryCode, shopperLocale, amount, ...rest } = context.args;
67

78
return useSessions
89
? await createSessionsCheckout({ showPayButton, countryCode, shopperLocale, amount })
910
: await createAdvancedFlowCheckout({
1011
showPayButton,
1112
countryCode,
1213
shopperLocale,
13-
amount
14+
amount,
15+
...reject(['componentConfiguration']).from(rest) // pass the "rest" of the specified config (excluding componentConfiguration, which is passed directly to the component)
1416
});
1517
}
1618

0 commit comments

Comments
 (0)