summaryrefslogtreecommitdiff
path: root/packages/frontend/src
diff options
context:
space:
mode:
authorzyoshoka <107108195+zyoshoka@users.noreply.github.com>2025-04-18 18:56:46 +0900
committerGitHub <noreply@github.com>2025-04-18 18:56:46 +0900
commit978ab2f848d4d37de6d3a4e6b2ecfc0adcbd09b7 (patch)
tree95836b3ef6e3959f1212c6c9a53e27c9ada0e8b0 /packages/frontend/src
parent🎨 (diff)
downloadsharkey-978ab2f848d4d37de6d3a4e6b2ecfc0adcbd09b7.tar.gz
sharkey-978ab2f848d4d37de6d3a4e6b2ecfc0adcbd09b7.tar.bz2
sharkey-978ab2f848d4d37de6d3a4e6b2ecfc0adcbd09b7.zip
fix(storybook): implement missing stories (#15862)
Diffstat (limited to 'packages/frontend/src')
-rw-r--r--packages/frontend/src/components/MkChatHistories.stories.impl.ts45
-rw-r--r--packages/frontend/src/components/MkDisableSection.stories.impl.ts7
2 files changed, 52 insertions, 0 deletions
diff --git a/packages/frontend/src/components/MkChatHistories.stories.impl.ts b/packages/frontend/src/components/MkChatHistories.stories.impl.ts
new file mode 100644
index 0000000000..8268adc36f
--- /dev/null
+++ b/packages/frontend/src/components/MkChatHistories.stories.impl.ts
@@ -0,0 +1,45 @@
+/*
+ * SPDX-FileCopyrightText: syuilo and misskey-project
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+import { http, HttpResponse } from 'msw';
+import { action } from '@storybook/addon-actions';
+import { chatMessage } from '../../.storybook/fakes';
+import MkChatHistories from './MkChatHistories.vue';
+import type { StoryObj } from '@storybook/vue3';
+import type * as Misskey from 'misskey-js';
+export const Default = {
+ render(args) {
+ return {
+ components: {
+ MkChatHistories,
+ },
+ setup() {
+ return {
+ args,
+ };
+ },
+ computed: {
+ props() {
+ return {
+ ...this.args,
+ };
+ },
+ },
+ template: '<MkChatHistories v-bind="props" />',
+ };
+ },
+ parameters: {
+ layout: 'centered',
+ msw: {
+ handlers: [
+ http.post('/api/chat/history', async ({ request }) => {
+ const body = await request.json() as Misskey.entities.ChatHistoryRequest;
+ action('POST /api/chat/history')(body);
+ return HttpResponse.json([chatMessage(body.room)]);
+ }),
+ ],
+ },
+ },
+} satisfies StoryObj<typeof MkChatHistories>;
diff --git a/packages/frontend/src/components/MkDisableSection.stories.impl.ts b/packages/frontend/src/components/MkDisableSection.stories.impl.ts
new file mode 100644
index 0000000000..78e556c63e
--- /dev/null
+++ b/packages/frontend/src/components/MkDisableSection.stories.impl.ts
@@ -0,0 +1,7 @@
+/*
+ * SPDX-FileCopyrightText: syuilo and misskey-project
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+import MkDisableSection from './MkDisableSection.vue';
+void MkDisableSection;