Skip to content

Commit

Permalink
update storybook with routerState
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewHEguardian committed Dec 14, 2023
1 parent f43708d commit 02b5669
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,19 @@ export default {
},
} as Meta<typeof CancellationContainer>;

export const DiscountThankYouPage: StoryFn<
typeof DigiSubDiscountConfirmed
> = () => {
return <DigiSubDiscountConfirmed />;
export const DiscountConfirmed: StoryObj<typeof DigiSubDiscountConfirmed> = {
render: () => {
return <DigiSubDiscountConfirmed />;
},
parameters: {
reactRouter: {
state: {
productDetail: digitalPackPaidByDirectDebit(),
user: { email: 'test@test.com' },
discountedPrice: 111.75,
},
},
},
};

export const EligibleForDiscount: StoryObj<typeof DigiSubThankYouOffer> = {
Expand All @@ -43,7 +52,7 @@ export const EligibleForDiscount: StoryObj<typeof DigiSubThankYouOffer> = {
parameters: {
msw: [
rest.post('/api/discounts/preview-discount', (_req, res, ctx) => {
return res(ctx.json({ valid: true }));
return res(ctx.json({ valid: true, discountedPrice: 111.75 }));
}),
],
},
Expand Down

0 comments on commit 02b5669

Please sign in to comment.