diff --git a/app/soapbox/features/groups/components/discover/search/__tests__/search.test.tsx b/app/soapbox/features/groups/components/discover/search/__tests__/search.test.tsx
new file mode 100644
index 000000000..698608363
--- /dev/null
+++ b/app/soapbox/features/groups/components/discover/search/__tests__/search.test.tsx
@@ -0,0 +1,62 @@
+import React from 'react';
+
+import { __stub } from 'soapbox/api';
+import { render, screen, waitFor } from 'soapbox/jest/test-helpers';
+import { normalizeGroup, normalizeInstance } from 'soapbox/normalizers';
+
+import Search from '../search';
+
+const store = {
+ instance: normalizeInstance({
+ version: '3.4.1 (compatible; TruthSocial 1.0.0+unreleased)',
+ }),
+};
+
+const renderApp = (children: React.ReactElement) => render(children, undefined, store);
+
+describe('', () => {
+ describe('with no results', () => {
+ beforeEach(() => {
+ __stub((mock) => {
+ mock.onGet('/api/v1/groups/search').reply(200, []);
+ });
+ });
+
+ it('should render the blankslate', async () => {
+ renderApp();
+
+ await waitFor(() => {
+ expect(screen.getByTestId('no-results')).toBeInTheDocument();
+ });
+ });
+ });
+
+ describe('with results', () => {
+ beforeEach(() => {
+ __stub((mock) => {
+ mock.onGet('/api/v1/groups/search').reply(200, [
+ normalizeGroup({
+ display_name: 'Group',
+ id: '1',
+ }),
+ ]);
+ });
+ });
+
+ it('should render the results', async () => {
+ renderApp();
+
+ await waitFor(() => {
+ expect(screen.getByTestId('results')).toBeInTheDocument();
+ });
+ });
+ });
+
+ describe('before starting a search', () => {
+ it('should render the RecentSearches component', () => {
+ renderApp();
+
+ expect(screen.getByTestId('recent-searches')).toBeInTheDocument();
+ });
+ });
+});
\ No newline at end of file
diff --git a/app/soapbox/features/groups/components/discover/search/no-results-blankslate.tsx b/app/soapbox/features/groups/components/discover/search/no-results-blankslate.tsx
index b4ff0d605..171348846 100644
--- a/app/soapbox/features/groups/components/discover/search/no-results-blankslate.tsx
+++ b/app/soapbox/features/groups/components/discover/search/no-results-blankslate.tsx
@@ -4,8 +4,8 @@ import { FormattedMessage } from 'react-intl';
import { Stack, Text } from 'soapbox/components/ui';
export default () => (
-
-
+
+
{
};
return (
-
+
{recentSearches.length > 0 ? (
<>
{
>
) : (
-
+
diff --git a/app/soapbox/features/groups/components/discover/search/results.tsx b/app/soapbox/features/groups/components/discover/search/results.tsx
index 08494ebdf..b51552f3d 100644
--- a/app/soapbox/features/groups/components/discover/search/results.tsx
+++ b/app/soapbox/features/groups/components/discover/search/results.tsx
@@ -101,7 +101,7 @@ export default (props: Props) => {
), []);
return (
-
+
Groups
diff --git a/app/soapbox/features/groups/components/discover/search/index.tsx b/app/soapbox/features/groups/components/discover/search/search.tsx
similarity index 100%
rename from app/soapbox/features/groups/components/discover/search/index.tsx
rename to app/soapbox/features/groups/components/discover/search/search.tsx
diff --git a/app/soapbox/features/groups/discover.tsx b/app/soapbox/features/groups/discover.tsx
index 4b40be492..4e0c0c70a 100644
--- a/app/soapbox/features/groups/discover.tsx
+++ b/app/soapbox/features/groups/discover.tsx
@@ -4,7 +4,7 @@ import { defineMessages, useIntl } from 'react-intl';
import { HStack, Icon, IconButton, Input, Stack } from 'soapbox/components/ui';
import PopularGroups from './components/discover/popular-groups';
-import Search from './components/discover/search';
+import Search from './components/discover/search/search';
import SuggestedGroups from './components/discover/suggested-groups';
import TabBar, { TabItems } from './components/tab-bar';