Add basic QuotedStatus test

chats-fixes
Alex Gleason 2022-06-08 11:25:41 -05:00
rodzic f3178ac911
commit 8a6ba4f048
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 28 dodań i 0 usunięć

Wyświetl plik

@ -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);
});
});

Wyświetl plik

@ -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,