1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-11-30 07:48:57 +09:00

chore(#10336): untrack generated stories files

This commit is contained in:
Acid Chicken (硫酸鶏) 2023-04-01 14:21:46 +09:00
parent f7bc442ba5
commit f5fd59d656
No known key found for this signature in database
GPG Key ID: 3E87B98A3F6BAB99
19 changed files with 1 additions and 882 deletions

1
.gitignore vendored
View File

@ -56,6 +56,7 @@ api-docs.json
/files
ormconfig.json
temp
/packages/frontend/src/**/*.stories.ts
# blender backups
*.blend1

View File

@ -1,54 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta } from '@storybook/vue3';
const meta = {
title: 'components/global/MkA',
component: MkA,
} satisfies Meta<typeof MkA>;
export default meta;
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import { expect } from '@storybook/jest';
import { userEvent, within } from '@storybook/testing-library';
import { StoryObj } from '@storybook/vue3';
import { tick } from '@/scripts/test-utils';
import MkA from './MkA.vue';
export const Default = {
render(args) {
return {
components: {
MkA,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<MkA v-bind="props">Text</MkA>',
};
},
async play({ canvasElement }) {
const canvas = within(canvasElement);
const a = canvas.getByRole<HTMLAnchorElement>('link');
await expect(a.href).toMatch(/^https?:\/\/.*#test$/);
await userEvent.click(a, { button: 2 });
await tick();
const menu = canvas.getByRole('menu');
await expect(menu).toBeInTheDocument();
await userEvent.click(a, { button: 0 });
await tick();
await expect(menu).not.toBeInTheDocument();
},
args: {
to: '#test',
},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkA>;

View File

@ -1,47 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta } from '@storybook/vue3';
const meta = {
title: 'components/global/MkAcct',
component: MkAcct,
} satisfies Meta<typeof MkAcct>;
export default meta;
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import { StoryObj } from '@storybook/vue3';
import { userDetailed } from '../../../.storybook/fakes';
import MkAcct from './MkAcct.vue';
export const Default = {
render(args) {
return {
components: {
MkAcct,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<MkAcct v-bind="props" />',
};
},
args: {
user: userDetailed,
},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkAcct>;
export const Detail = {
...Default,
args: {
...Default.args,
detail: true,
},
} satisfies StoryObj<typeof MkAcct>;

View File

@ -1,130 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta } from '@storybook/vue3';
const meta = {
title: 'components/global/MkAd',
component: MkAd,
} satisfies Meta<typeof MkAd>;
export default meta;
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import { expect } from '@storybook/jest';
import { userEvent, within } from '@storybook/testing-library';
import { StoryObj } from '@storybook/vue3';
import { i18n } from '@/i18n';
import MkAd from './MkAd.vue';
const common = {
render(args) {
return {
components: {
MkAd,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<MkAd v-bind="props" />',
};
},
async play({ canvasElement, args }) {
const canvas = within(canvasElement);
const a = canvas.getByRole<HTMLAnchorElement>('link');
await expect(a.href).toMatch(/^https?:\/\/.*#test$/);
const img = within(a).getByRole('img');
await expect(img).toBeInTheDocument();
let buttons = canvas.getAllByRole<HTMLButtonElement>('button');
await expect(buttons).toHaveLength(1);
const i = buttons[0];
await expect(i).toBeInTheDocument();
await userEvent.click(i);
await expect(a).not.toBeInTheDocument();
await expect(i).not.toBeInTheDocument();
buttons = canvas.getAllByRole<HTMLButtonElement>('button');
await expect(buttons).toHaveLength(args.__hasReduce ? 2 : 1);
const reduce = args.__hasReduce ? buttons[0] : null;
const back = buttons[args.__hasReduce ? 1 : 0];
if (reduce) {
await expect(reduce).toBeInTheDocument();
await expect(reduce).toHaveTextContent(
i18n.ts._ad.reduceFrequencyOfThisAd
);
}
await expect(back).toBeInTheDocument();
await expect(back).toHaveTextContent(i18n.ts._ad.back);
await userEvent.click(back);
if (reduce) {
await expect(reduce).not.toBeInTheDocument();
}
await expect(back).not.toBeInTheDocument();
const aAgain = canvas.getByRole<HTMLAnchorElement>('link');
await expect(aAgain).toBeInTheDocument();
const imgAgain = within(aAgain).getByRole('img');
await expect(imgAgain).toBeInTheDocument();
},
args: {
prefer: [],
specify: {
id: 'someadid',
radio: 1,
url: '#test',
},
__hasReduce: true,
},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkAd>;
export const Square = {
...common,
args: {
...common.args,
specify: {
...common.args.specify,
place: 'square',
imageUrl:
'https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/about-icon.png?raw=true',
},
},
};
export const Horizontal = {
...common,
args: {
...common.args,
specify: {
...common.args.specify,
place: 'horizontal',
imageUrl:
'https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/fedi.jpg?raw=true',
},
},
};
export const HorizontalBig = {
...common,
args: {
...common.args,
specify: {
...common.args.specify,
place: 'horizontal-big',
imageUrl:
'https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/fedi.jpg?raw=true',
},
},
};
export const ZeroRatio = {
...Square,
args: {
...Square.args,
specify: {
...Square.args.specify,
ratio: 0,
},
__hasReduce: false,
},
};

View File

@ -1,65 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta } from '@storybook/vue3';
const meta = {
title: 'components/global/MkAvatar',
component: MkAvatar,
} satisfies Meta<typeof MkAvatar>;
export default meta;
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-duplicates */
import { StoryObj } from '@storybook/vue3';
import { userDetailed } from '../../../.storybook/fakes';
import MkAvatar from './MkAvatar.vue';
const common = {
render(args) {
return {
components: {
MkAvatar,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<MkAvatar v-bind="props" />',
};
},
args: {
user: userDetailed,
},
decorators: [
(Story, context) => ({
// eslint-disable-next-line quotes
template: `<div :style="{ display: 'grid', width: '${context.args.size}px', height: '${context.args.size}px' }"><story/></div>`,
}),
],
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkAvatar>;
export const ProfilePage = {
...common,
args: {
...common.args,
size: 120,
indicator: true,
},
};
export const ProfilePageCat = {
...ProfilePage,
args: {
...ProfilePage.args,
user: {
...userDetailed,
isCat: true,
},
},
};

View File

@ -1,54 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta } from '@storybook/vue3';
const meta = {
title: 'components/global/MkCustomEmoji',
component: MkCustomEmoji,
} satisfies Meta<typeof MkCustomEmoji>;
export default meta;
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-duplicates */
import { StoryObj } from '@storybook/vue3';
import MkCustomEmoji from './MkCustomEmoji.vue';
export const Default = {
render(args) {
return {
components: {
MkCustomEmoji,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<MkCustomEmoji v-bind="props" />',
};
},
args: {
name: 'mi',
url: 'https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/about-icon.png?raw=true',
},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkCustomEmoji>;
export const Normal = {
...Default,
args: {
...Default.args,
normal: true,
},
};
export const Missing = {
...Default,
args: {
name: Default.args.name,
},
};

View File

@ -1,34 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta, StoryObj } from '@storybook/vue3';
import MkEllipsis from './MkEllipsis.vue';
const meta = {
title: 'components/global/MkEllipsis',
component: MkEllipsis,
} satisfies Meta<typeof MkEllipsis>;
export const Default = {
render(args) {
return {
components: {
MkEllipsis,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<MkEllipsis v-bind="props" />',
};
},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkEllipsis>;
export default meta;

View File

@ -1,40 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta } from '@storybook/vue3';
const meta = {
title: 'components/global/MkEmoji',
component: MkEmoji,
} satisfies Meta<typeof MkEmoji>;
export default meta;
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-duplicates */
import { StoryObj } from '@storybook/vue3';
import MkEmoji from './MkEmoji.vue';
export const Default = {
render(args) {
return {
components: {
MkEmoji,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<MkEmoji v-bind="props" />',
};
},
args: {
emoji: '❤',
},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkEmoji>;

View File

@ -1,36 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta, StoryObj } from '@storybook/vue3';
import MkError from './MkError.vue';
import * as storiesMeta from './MkError.stories.meta';
const meta = {
title: 'components/global/MkError',
component: MkError,
...storiesMeta,
} satisfies Meta<typeof MkError>;
export const Default = {
render(args) {
return {
components: {
MkError,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<MkError v-bind="props" />',
};
},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkError>;
export default meta;

View File

@ -1,65 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta } from '@storybook/vue3';
const meta = {
title: 'components/global/MkLoading',
component: MkLoading,
} satisfies Meta<typeof MkLoading>;
export default meta;
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import { StoryObj } from '@storybook/vue3';
import MkLoading from './MkLoading.vue';
export const Default = {
render(args) {
return {
components: {
MkLoading,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<MkLoading v-bind="props" />',
};
},
args: {},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkLoading>;
export const Inline = {
...Default,
args: {
...Default.args,
inline: true,
},
};
export const Colored = {
...Default,
args: {
...Default.args,
colored: true,
},
};
export const Mini = {
...Default,
args: {
...Default.args,
mini: true,
},
};
export const Em = {
...Default,
args: {
...Default.args,
em: true,
},
};

View File

@ -1,85 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta } from '@storybook/vue3';
const meta = {
title: 'components/global/MkMisskeyFlavoredMarkdown',
component: MkMisskeyFlavoredMarkdown,
} satisfies Meta<typeof MkMisskeyFlavoredMarkdown>;
export default meta;
/* eslint-disable @typescript-eslint/explicit-function-return-type */
import { StoryObj } from '@storybook/vue3';
import MkMisskeyFlavoredMarkdown from './MkMisskeyFlavoredMarkdown.vue';
import { within } from '@storybook/testing-library';
import { expect } from '@storybook/jest';
export const Default = {
render(args) {
return {
components: {
MkMisskeyFlavoredMarkdown,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<MkMisskeyFlavoredMarkdown v-bind="props" />',
};
},
async play({ canvasElement, args }) {
const canvas = within(canvasElement);
if (args.plain) {
const aiHelloMiskist = canvas.getByText('@ai *Hello*, #Miskist!');
await expect(aiHelloMiskist).toBeInTheDocument();
} else {
const ai = canvas.getByText('@ai');
await expect(ai).toBeInTheDocument();
await expect(ai.closest('a')).toHaveAttribute('href', '/@ai');
const hello = canvas.getByText('Hello');
await expect(hello).toBeInTheDocument();
await expect(hello.style.fontStyle).toBe('oblique');
const miskist = canvas.getByText('#Miskist');
await expect(miskist).toBeInTheDocument();
await expect(miskist).toHaveAttribute(
'href',
args.isNote ?? true ? '/tags/Miskist' : '/user-tags/Miskist'
);
}
const heart = canvas.getByAltText('❤');
await expect(heart).toBeInTheDocument();
await expect(heart).toHaveAttribute('src', '/twemoji/2764.svg');
},
args: {
text: '@ai *Hello*, #Miskist! ❤',
},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkMisskeyFlavoredMarkdown>;
export const Plain = {
...Default,
args: {
...Default.args,
plain: true,
},
};
export const Nowrap = {
...Default,
args: {
...Default.args,
nowrap: true,
},
};
export const IsNotNote = {
...Default,
args: {
...Default.args,
isNote: false,
},
};

View File

@ -1,34 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta, StoryObj } from '@storybook/vue3';
import MkPageHeader from './MkPageHeader.vue';
const meta = {
title: 'components/global/MkPageHeader',
component: MkPageHeader,
} satisfies Meta<typeof MkPageHeader>;
export const Default = {
render(args) {
return {
components: {
MkPageHeader,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<MkPageHeader v-bind="props" />',
};
},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkPageHeader>;
export default meta;

View File

@ -1,34 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta, StoryObj } from '@storybook/vue3';
import MkPageHeader_tabs from './MkPageHeader.tabs.vue';
const meta = {
title: 'components/global/MkPageHeader/tabs',
component: MkPageHeader_tabs,
} satisfies Meta<typeof MkPageHeader_tabs>;
export const Default = {
render(args) {
return {
components: {
MkPageHeader_tabs,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<MkPageHeader_tabs v-bind="props" />',
};
},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkPageHeader_tabs>;
export default meta;

View File

@ -1,34 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta, StoryObj } from '@storybook/vue3';
import MkSpacer from './MkSpacer.vue';
const meta = {
title: 'components/global/MkSpacer',
component: MkSpacer,
} satisfies Meta<typeof MkSpacer>;
export const Default = {
render(args) {
return {
components: {
MkSpacer,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<MkSpacer v-bind="props" />',
};
},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkSpacer>;
export default meta;

View File

@ -1,34 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta, StoryObj } from '@storybook/vue3';
import MkStickyContainer from './MkStickyContainer.vue';
const meta = {
title: 'components/global/MkStickyContainer',
component: MkStickyContainer,
} satisfies Meta<typeof MkStickyContainer>;
export const Default = {
render(args) {
return {
components: {
MkStickyContainer,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<MkStickyContainer v-bind="props" />',
};
},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkStickyContainer>;
export default meta;

View File

@ -1,34 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta, StoryObj } from '@storybook/vue3';
import MkTime from './MkTime.vue';
const meta = {
title: 'components/global/MkTime',
component: MkTime,
} satisfies Meta<typeof MkTime>;
export const Default = {
render(args) {
return {
components: {
MkTime,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<MkTime v-bind="props" />',
};
},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkTime>;
export default meta;

View File

@ -1,34 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta, StoryObj } from '@storybook/vue3';
import MkUrl from './MkUrl.vue';
const meta = {
title: 'components/global/MkUrl',
component: MkUrl,
} satisfies Meta<typeof MkUrl>;
export const Default = {
render(args) {
return {
components: {
MkUrl,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<MkUrl v-bind="props" />',
};
},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkUrl>;
export default meta;

View File

@ -1,34 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta, StoryObj } from '@storybook/vue3';
import MkUserName from './MkUserName.vue';
const meta = {
title: 'components/global/MkUserName',
component: MkUserName,
} satisfies Meta<typeof MkUserName>;
export const Default = {
render(args) {
return {
components: {
MkUserName,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<MkUserName v-bind="props" />',
};
},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof MkUserName>;
export default meta;

View File

@ -1,34 +0,0 @@
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable import/no-default-export */
import { Meta, StoryObj } from '@storybook/vue3';
import RouterView from './RouterView.vue';
const meta = {
title: 'components/global/RouterView',
component: RouterView,
} satisfies Meta<typeof RouterView>;
export const Default = {
render(args) {
return {
components: {
RouterView,
},
setup() {
return {
args,
};
},
computed: {
props() {
return {
...args,
};
},
},
template: '<RouterView v-bind="props" />',
};
},
parameters: {
layout: 'centered',
},
} satisfies StoryObj<typeof RouterView>;
export default meta;