Skip to content

Commit 02b5669

Browse files
update storybook with routerState
1 parent f43708d commit 02b5669

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

client/components/mma/cancel/cancellationSaves/digipack/DigiSubSaves.stories.tsx

+14-5
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,19 @@ export default {
3030
},
3131
} as Meta<typeof CancellationContainer>;
3232

33-
export const DiscountThankYouPage: StoryFn<
34-
typeof DigiSubDiscountConfirmed
35-
> = () => {
36-
return <DigiSubDiscountConfirmed />;
33+
export const DiscountConfirmed: StoryObj<typeof DigiSubDiscountConfirmed> = {
34+
render: () => {
35+
return <DigiSubDiscountConfirmed />;
36+
},
37+
parameters: {
38+
reactRouter: {
39+
state: {
40+
productDetail: digitalPackPaidByDirectDebit(),
41+
user: { email: '[email protected]' },
42+
discountedPrice: 111.75,
43+
},
44+
},
45+
},
3746
};
3847

3948
export const EligibleForDiscount: StoryObj<typeof DigiSubThankYouOffer> = {
@@ -43,7 +52,7 @@ export const EligibleForDiscount: StoryObj<typeof DigiSubThankYouOffer> = {
4352
parameters: {
4453
msw: [
4554
rest.post('/api/discounts/preview-discount', (_req, res, ctx) => {
46-
return res(ctx.json({ valid: true }));
55+
return res(ctx.json({ valid: true, discountedPrice: 111.75 }));
4756
}),
4857
],
4958
},

0 commit comments

Comments
 (0)