Add stub story for StatusQuoteManager / Status component (#37321)
This commit is contained in:
parent
4e63958914
commit
8d9192835d
35
app/javascript/mastodon/components/status_quoted.stories.tsx
Normal file
35
app/javascript/mastodon/components/status_quoted.stories.tsx
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
||||||
|
|
||||||
|
import { accountFactoryState, statusFactoryState } from '@/testing/factories';
|
||||||
|
|
||||||
|
import type { StatusQuoteManagerProps } from './status_quoted';
|
||||||
|
import { StatusQuoteManager } from './status_quoted';
|
||||||
|
|
||||||
|
const meta = {
|
||||||
|
title: 'Components/Status/StatusQuoteManager',
|
||||||
|
render(args) {
|
||||||
|
return <StatusQuoteManager {...args} />;
|
||||||
|
},
|
||||||
|
args: {
|
||||||
|
id: '1',
|
||||||
|
},
|
||||||
|
parameters: {
|
||||||
|
state: {
|
||||||
|
accounts: {
|
||||||
|
'1': accountFactoryState({ id: '1', acct: 'hashtaguser' }),
|
||||||
|
},
|
||||||
|
statuses: {
|
||||||
|
'1': statusFactoryState({
|
||||||
|
id: '1',
|
||||||
|
text: 'Hello world!',
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
} satisfies Meta<StatusQuoteManagerProps>;
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
|
||||||
|
type Story = StoryObj<typeof meta>;
|
||||||
|
|
||||||
|
export const Default: Story = {};
|
||||||
@ -4,20 +4,19 @@ import { FormattedMessage } from 'react-intl';
|
|||||||
|
|
||||||
import type { Map as ImmutableMap } from 'immutable';
|
import type { Map as ImmutableMap } from 'immutable';
|
||||||
|
|
||||||
|
import { fetchRelationships } from 'mastodon/actions/accounts';
|
||||||
|
import { revealAccount } from 'mastodon/actions/accounts_typed';
|
||||||
|
import { fetchStatus } from 'mastodon/actions/statuses';
|
||||||
import { LearnMoreLink } from 'mastodon/components/learn_more_link';
|
import { LearnMoreLink } from 'mastodon/components/learn_more_link';
|
||||||
import StatusContainer from 'mastodon/containers/status_container';
|
import StatusContainer from 'mastodon/containers/status_container';
|
||||||
import { domain } from 'mastodon/initial_state';
|
import { domain } from 'mastodon/initial_state';
|
||||||
import type { Account } from 'mastodon/models/account';
|
import type { Account } from 'mastodon/models/account';
|
||||||
import type { Status } from 'mastodon/models/status';
|
import type { Status } from 'mastodon/models/status';
|
||||||
|
import { makeGetStatusWithExtraInfo } from 'mastodon/selectors';
|
||||||
|
import { getAccountHidden } from 'mastodon/selectors/accounts';
|
||||||
import type { RootState } from 'mastodon/store';
|
import type { RootState } from 'mastodon/store';
|
||||||
import { useAppDispatch, useAppSelector } from 'mastodon/store';
|
import { useAppDispatch, useAppSelector } from 'mastodon/store';
|
||||||
|
|
||||||
import { fetchRelationships } from '../actions/accounts';
|
|
||||||
import { revealAccount } from '../actions/accounts_typed';
|
|
||||||
import { fetchStatus } from '../actions/statuses';
|
|
||||||
import { makeGetStatusWithExtraInfo } from '../selectors';
|
|
||||||
import { getAccountHidden } from '../selectors/accounts';
|
|
||||||
|
|
||||||
import { Button } from './button';
|
import { Button } from './button';
|
||||||
|
|
||||||
const MAX_QUOTE_POSTS_NESTING_LEVEL = 1;
|
const MAX_QUOTE_POSTS_NESTING_LEVEL = 1;
|
||||||
@ -333,7 +332,7 @@ export const QuotedStatus: React.FC<QuotedStatusProps> = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
interface StatusQuoteManagerProps {
|
export interface StatusQuoteManagerProps {
|
||||||
id: string;
|
id: string;
|
||||||
contextType?: string;
|
contextType?: string;
|
||||||
[key: string]: unknown;
|
[key: string]: unknown;
|
||||||
|
|||||||
@ -76,7 +76,7 @@ export const statusFactory: FactoryFunction<ApiStatusJSON> = ({
|
|||||||
mentions: [],
|
mentions: [],
|
||||||
tags: [],
|
tags: [],
|
||||||
emojis: [],
|
emojis: [],
|
||||||
contentHtml: '<p>This is a test status.</p>',
|
contentHtml: data.text ?? '<p>This is a test status.</p>',
|
||||||
...data,
|
...data,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user