-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add CheckoutPage Storybook stories
- Loading branch information
1 parent
645ad62
commit 57e8dec
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { | ||
withCheckoutStateDecorator, | ||
withRootAppLayoutDecorator, | ||
type CheckoutStateDecoratorArgs, | ||
} from "@/../.storybook/decorators"; | ||
import { authenticatedUserStore } from "@/stores/authenticatedUserStore"; | ||
import { isAuthenticatedStore } from "@/stores/isAuthenticatedStore"; | ||
import { STATIC_MOCK_USERS } from "@/tests/mockItems/staticMockUsers"; | ||
import { CheckoutPage, type CheckoutPageProps } from "./CheckoutPage"; | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
const meta = { | ||
title: "Pages/CheckoutPage", | ||
component: CheckoutPage, | ||
decorators: [withRootAppLayoutDecorator, withCheckoutStateDecorator], | ||
parameters: { | ||
layout: "fullscreen", | ||
}, | ||
} satisfies Meta<CheckoutPageProps & CheckoutStateDecoratorArgs>; | ||
|
||
export default meta; | ||
|
||
/////////////////////////////////////////////////////////// | ||
// STORIES | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
authenticatedUserStore.set(STATIC_MOCK_USERS.Guy_McPerson as any); | ||
isAuthenticatedStore.set(true); | ||
|
||
export const AnnualPricing = { | ||
args: { | ||
_checkout_state_decorator_args: { | ||
checkoutState: { | ||
selectedSubscription: "ANNUAL", | ||
promoCode: null, | ||
}, | ||
}, | ||
}, | ||
} satisfies Story; | ||
|
||
export const MonthlyPricing = { | ||
args: { | ||
_checkout_state_decorator_args: { | ||
checkoutState: { | ||
selectedSubscription: "MONTHLY", | ||
promoCode: null, | ||
}, | ||
}, | ||
}, | ||
} satisfies Story; | ||
|
||
export const TrialPricing = { | ||
args: { | ||
_checkout_state_decorator_args: { | ||
checkoutState: { | ||
selectedSubscription: "TRIAL", | ||
promoCode: null, | ||
}, | ||
}, | ||
}, | ||
} satisfies Story; | ||
|
||
export const PaymentConfirmed = { | ||
args: { | ||
...AnnualPricing.args, | ||
showPaymentConfirmation: true, | ||
}, | ||
} satisfies Story; |