sforkowany z mirror/soapbox
Add basic QuotedStatus test
rodzic
f3178ac911
commit
8a6ba4f048
|
@ -0,0 +1,27 @@
|
|||
import React from 'react';
|
||||
|
||||
import { render, screen, rootState } from '../../jest/test-helpers';
|
||||
import { normalizeStatus, normalizeAccount } from '../../normalizers';
|
||||
import QuotedStatus from '../quoted-status';
|
||||
|
||||
describe('<QuotedStatus />', () => {
|
||||
it('renders content', () => {
|
||||
const account = normalizeAccount({
|
||||
id: '1',
|
||||
acct: 'alex',
|
||||
});
|
||||
|
||||
const status = normalizeStatus({
|
||||
id: '1',
|
||||
account,
|
||||
content: 'hello world',
|
||||
contentHtml: 'hello world',
|
||||
});
|
||||
|
||||
const state = rootState.setIn(['accounts', '1', account]);
|
||||
|
||||
render(<QuotedStatus status={status} />, null, state);
|
||||
screen.getByText(/hello world/i);
|
||||
expect(screen.getByTestId('quoted-status')).toHaveTextContent(/hello world/i);
|
||||
});
|
||||
});
|
|
@ -124,6 +124,7 @@ const QuotedStatus: React.FC<IQuotedStatus> = ({ status, onCancel, compose }) =>
|
|||
|
||||
return (
|
||||
<Stack
|
||||
data-testid='quoted-status'
|
||||
space={2}
|
||||
className={classNames('mt-3 p-4 rounded-lg border border-solid border-gray-100 dark:border-slate-700 cursor-pointer', {
|
||||
'hover:bg-gray-50 dark:hover:bg-slate-700': !compose,
|
||||
|
|
Ładowanie…
Reference in New Issue