diff --git a/app/soapbox/components/__tests__/scroll-top-button.test.js b/app/soapbox/components/__tests__/scroll-top-button.test.js
index c23a733ef..89518b977 100644
--- a/app/soapbox/components/__tests__/scroll-top-button.test.js
+++ b/app/soapbox/components/__tests__/scroll-top-button.test.js
@@ -1,4 +1,3 @@
-import { fromJS } from 'immutable';
import React from 'react';
import { defineMessages } from 'react-intl';
@@ -14,37 +13,31 @@ describe('', () => {
render(
{}} // eslint-disable-line react/jsx-no-bind
- timelineId='home'
+ onClick={() => {}}
+ count={0}
message={messages.queue}
/>,
- undefined,
- { timelines: fromJS({ home: { totalQueuedItemsCount: 0 } }) },
);
expect(screen.queryAllByRole('link')).toHaveLength(0);
render(
{}} // eslint-disable-line react/jsx-no-bind
- timelineId='home'
+ onClick={() => {}}
+ count={1}
message={messages.queue}
/>,
- undefined,
- { timelines: fromJS({ home: { totalQueuedItemsCount: 1 } }) },
);
- expect(screen.getByText(/Click to see\s+1\s+new post/, { hidden: true })).toBeInTheDocument();
+ expect(screen.getByText('Click to see 1 new post', { hidden: true })).toBeInTheDocument();
render(
{}} // eslint-disable-line react/jsx-no-bind
- timelineId='home'
+ onClick={() => {}}
+ count={9999999}
message={messages.queue}
/>,
- undefined,
- { timelines: fromJS({ home: { totalQueuedItemsCount: 9999999 } }) },
);
- expect(screen.getByText(/10.*M/, { hidden: true })).toBeInTheDocument();
+ expect(screen.getByText('Click to see 9999999 new posts', { hidden: true })).toBeInTheDocument();
});
});
diff --git a/app/soapbox/components/scroll-top-button.tsx b/app/soapbox/components/scroll-top-button.tsx
index 698c92779..eb5d00593 100644
--- a/app/soapbox/components/scroll-top-button.tsx
+++ b/app/soapbox/components/scroll-top-button.tsx
@@ -6,7 +6,6 @@ import { useIntl, MessageDescriptor } from 'react-intl';
import Icon from 'soapbox/components/icon';
import { Text } from 'soapbox/components/ui';
import { useSettings } from 'soapbox/hooks';
-import { shortNumberFormat } from 'soapbox/utils/numbers';
interface IScrollTopButton {
/** Callback when clicked, and also when scrolled to the top. */
@@ -79,7 +78,7 @@ const ScrollTopButton: React.FC = ({
{(count > 0) && (
- {intl.formatMessage(message, { count: shortNumberFormat(count) })}
+ {intl.formatMessage(message, { count })}
)}