summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkUserSetupDialog.stories.impl.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-05-08 17:29:19 +0900
committerGitHub <noreply@github.com>2023-05-08 17:29:19 +0900
commit85a4c8dbb1cd455ac538d8004dafc47d4d6d400f (patch)
tree32cd21e25a3b2300e57f36f527f1f3e635f8b8e4 /packages/frontend/src/components/MkUserSetupDialog.stories.impl.ts
parentrefactor(frontend): use css modules (diff)
downloadsharkey-85a4c8dbb1cd455ac538d8004dafc47d4d6d400f.tar.gz
sharkey-85a4c8dbb1cd455ac538d8004dafc47d4d6d400f.tar.bz2
sharkey-85a4c8dbb1cd455ac538d8004dafc47d4d6d400f.zip
feat(frontend): アカウント初期設定ウィザード (#10799)
* wip * :art: * :art: * wip * wip * :art: * Update CHANGELOG.md * wip * Update MkUserSetupDialog.vue * add stories Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com> * update stories * Update MkUserSetupDialog.Follow.stories.impl.ts * test: load mock user account * :v: * :v: * test: reset on each render * test: use id to identify --------- Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Diffstat (limited to 'packages/frontend/src/components/MkUserSetupDialog.stories.impl.ts')
-rw-r--r--packages/frontend/src/components/MkUserSetupDialog.stories.impl.ts51
1 files changed, 51 insertions, 0 deletions
diff --git a/packages/frontend/src/components/MkUserSetupDialog.stories.impl.ts b/packages/frontend/src/components/MkUserSetupDialog.stories.impl.ts
new file mode 100644
index 0000000000..55790602d5
--- /dev/null
+++ b/packages/frontend/src/components/MkUserSetupDialog.stories.impl.ts
@@ -0,0 +1,51 @@
+/* eslint-disable @typescript-eslint/explicit-function-return-type */
+import { StoryObj } from '@storybook/vue3';
+import { rest } from 'msw';
+import { commonHandlers } from '../../.storybook/mocks';
+import { userDetailed } from '../../.storybook/fakes';
+import MkUserSetupDialog from './MkUserSetupDialog.vue';
+export const Default = {
+ render(args) {
+ return {
+ components: {
+ MkUserSetupDialog,
+ },
+ setup() {
+ return {
+ args,
+ };
+ },
+ computed: {
+ props() {
+ return {
+ ...this.args,
+ };
+ },
+ },
+ template: '<MkUserSetupDialog v-bind="props" />',
+ };
+ },
+ args: {
+
+ },
+ parameters: {
+ layout: 'centered',
+ msw: {
+ handlers: [
+ ...commonHandlers,
+ rest.post('/api/users', (req, res, ctx) => {
+ return res(ctx.json([
+ userDetailed('44'),
+ userDetailed('49'),
+ ]));
+ }),
+ rest.post('/api/pinned-users', (req, res, ctx) => {
+ return res(ctx.json([
+ userDetailed('44'),
+ userDetailed('49'),
+ ]));
+ }),
+ ],
+ },
+ },
+} satisfies StoryObj<typeof MkUserSetupDialog>;