bigbuffet-rw/packages/pl-fe/src/components/quoted-status.test.tsx
marcin mikołajczak 966b04fdf0 Call it pl-fe internally
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-08-28 13:41:08 +02:00

31 lines
891 B
TypeScript

import React from 'react';
import { render, screen, rootState } from 'pl-fe/jest/test-helpers';
import { normalizeStatus, normalizeAccount } from 'pl-fe/normalizers';
import QuotedStatus from './quoted-status';
import type { ReducerStatus } from 'pl-fe/reducers/statuses';
describe('<QuotedStatus />', () => {
it('renders content', () => {
const account = normalizeAccount({
id: '1',
acct: 'alex',
url: 'https://soapbox.test/users/alex',
});
const status = normalizeStatus({
id: '1',
account,
content: 'hello world',
contentHtml: 'hello world',
}) as ReducerStatus;
const state = rootState.setIn(['accounts', '1'], account);
render(<QuotedStatus status={status} />, undefined, state);
screen.getByText(/hello world/i);
expect(screen.getByTestId('quoted-status')).toHaveTextContent(/hello world/i);
});
});