Skip to content

Commit

Permalink
build: add CheckoutPage Storybook stories
Browse files Browse the repository at this point in the history
  • Loading branch information
trevor-anderson committed Feb 20, 2024
1 parent 645ad62 commit 57e8dec
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions src/pages/CheckoutPage/CheckoutPage.stories.tsx
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;

0 comments on commit 57e8dec

Please sign in to comment.