Skip to content

Commit

Permalink
chore: added story for add-payment-method form
Browse files Browse the repository at this point in the history
  • Loading branch information
mwargan committed Mar 6, 2024
1 parent b3278b0 commit ace7021
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ VITE_APP_NAME="App Name"
VITE_PUSHER_KEY=
VITE_GA_MEASUREMENT_ID=
VITE_API_URL=http://192.168.10.17/
VITE_STRIPE_KEY=
VITE_STRIPE_KEY=sk-test-01
40 changes: 40 additions & 0 deletions src/stories/AddPaymentMethod.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import type { Meta, StoryObj } from "@storybook/vue3";

import AddPaymentMethod from "@/forms/AddPaymentMethod.vue";
import { useUserStore } from "@/stores/user";

import userFixture from "../../cypress/fixtures/user.json";

// More on how to set up stories at: https://storybook.js.org/docs/writing-stories
const meta: Meta<typeof AddPaymentMethod> = {
title: "Forms/AddPaymentMethod",
component: AddPaymentMethod,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/writing-docs/autodocs
tags: ["autodocs"],
};

export default meta;
type Story = StoryObj<typeof AddPaymentMethod>;
/*
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const Default: Story = {
render: (args) => ({
components: { AddPaymentMethod },
setup() {
const user = useUserStore();
user.isAuthenticated = true;
user.user = {
...userFixture,
seen_at: new Date(),
created_at: new Date(),
updated_at: new Date(),
};
return { args };
},
template:
"<AddPaymentMethod v-bind='args'><input type='email' name='email' required placeholder='Email' /><input type='password' name='password' required placeholder='Password' /></AddPaymentMethod>",
}),
};

0 comments on commit ace7021

Please sign in to comment.