From 330bf8e74d7bc722da54d9b376f93cd2162f5944 Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 17 May 2022 12:47:32 -0400 Subject: [PATCH] Improve Trends test coverage --- app/soapbox/components/hashtag.tsx | 2 +- .../ui/components/__tests__/trends-panel.test.tsx | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/soapbox/components/hashtag.tsx b/app/soapbox/components/hashtag.tsx index 06d44d467..c8e45a084 100644 --- a/app/soapbox/components/hashtag.tsx +++ b/app/soapbox/components/hashtag.tsx @@ -42,7 +42,7 @@ const Hashtag: React.FC = ({ hashtag }) => { {hashtag.get('history') && ( -
+
', () => { trends: ImmutableMap({ items: fromJS([{ name: 'hashtag 1', - history: [{ accounts: [] }], + history: [{ + day: '1652745600', + uses: '294', + accounts: '180', + }], }]), }), }; render(, null, store); expect(screen.getByTestId('hashtag')).toHaveTextContent(/hashtag 1/i); + expect(screen.getByTestId('hashtag')).toHaveTextContent(/180 people talking/i); + expect(screen.getByTestId('sparklines')).toBeInTheDocument(); }); it('renders multiple trends', () => {