From 8a6ba4f04828f834cca807fbe7da9af549f4e718 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 8 Jun 2022 11:25:41 -0500 Subject: [PATCH] Add basic QuotedStatus test --- .../__tests__/quoted-status.test.tsx | 27 +++++++++++++++++++ app/soapbox/components/quoted-status.tsx | 1 + 2 files changed, 28 insertions(+) create mode 100644 app/soapbox/components/__tests__/quoted-status.test.tsx diff --git a/app/soapbox/components/__tests__/quoted-status.test.tsx b/app/soapbox/components/__tests__/quoted-status.test.tsx new file mode 100644 index 000000000..208a913b2 --- /dev/null +++ b/app/soapbox/components/__tests__/quoted-status.test.tsx @@ -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('', () => { + 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(, null, state); + screen.getByText(/hello world/i); + expect(screen.getByTestId('quoted-status')).toHaveTextContent(/hello world/i); + }); +}); diff --git a/app/soapbox/components/quoted-status.tsx b/app/soapbox/components/quoted-status.tsx index 33ce023c4..5d6eb526e 100644 --- a/app/soapbox/components/quoted-status.tsx +++ b/app/soapbox/components/quoted-status.tsx @@ -124,6 +124,7 @@ const QuotedStatus: React.FC = ({ status, onCancel, compose }) => return (