From 3f640e9797c80a8e48999ebadea7f9fa07ad6745 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 2 Oct 2023 14:27:40 -0500 Subject: [PATCH] Untuck tests out of __tests__ directories, colocate with program files --- src/actions/{__tests__ => }/about.test.ts | 2 +- .../{__tests__ => }/account-notes.test.ts | 2 +- src/actions/{__tests__ => }/accounts.test.ts | 4 +- .../{__tests__ => }/announcements.test.ts | 0 src/actions/{__tests__ => }/blocks.test.ts | 2 +- src/actions/{__tests__ => }/compose.test.ts | 4 +- src/actions/{__tests__ => }/me.test.ts | 2 +- .../{__tests__ => }/notifications.test.ts | 2 +- .../{__tests__ => }/onboarding.test.ts | 2 +- src/actions/{__tests__ => }/preload.test.ts | 6 +- src/actions/{__tests__ => }/rules.test.ts | 2 +- src/actions/{__tests__ => }/soapbox.test.ts | 2 +- .../{__tests__ => }/status-quotes.test.ts | 2 +- src/actions/{__tests__ => }/statuses.test.ts | 2 +- .../groups/{__tests__ => }/useGroup.test.ts | 2 +- .../{__tests__ => }/useGroupLookup.test.ts | 2 +- .../{__tests__ => }/useGroupMedia.test.ts | 2 +- .../{__tests__ => }/useGroupMembers.test.ts | 2 +- .../groups/{__tests__ => }/useGroups.test.ts | 2 +- .../{__tests__ => }/usePendingGroups.test.ts | 2 +- .../{__tests__ => }/account.test.tsx | 4 +- .../autosuggest-emoji.test.tsx | 5 +- src/components/{__tests__ => }/badge.test.tsx | 5 +- .../{__tests__ => }/display-name.test.tsx | 4 +- .../{__tests__ => }/poll-footer.test.tsx | 2 +- .../{__tests__ => }/quoted-status.test.tsx | 7 +- .../scroll-top-button.test.tsx | 5 +- .../{__tests__ => }/status.test.tsx | 2 +- .../sensitive-content-overlay.test.tsx | 4 +- .../ui/avatar/{__tests__ => }/avatar.test.tsx | 5 +- .../ui/button/{__tests__ => }/button.test.tsx | 5 +- .../ui/card/{__tests__ => }/card.test.tsx | 5 +- .../ui/column/{__tests__ => }/column.test.tsx | 5 +- .../{__tests__ => }/datepicker.test.tsx | 5 +- .../divider/{__tests__ => }/divider.test.tsx | 5 +- .../ui/emoji/{__tests__ => }/emoji.test.tsx | 5 +- .../{__tests__ => }/form-actions.test.tsx | 5 +- .../{__tests__ => }/form-group.test.tsx | 5 +- .../ui/form/{__tests__ => }/form.test.tsx | 5 +- .../ui/icon/{__tests__ => }/svg-icon.test.tsx | 5 +- .../ui/modal/{__tests__ => }/modal.test.tsx | 5 +- .../validation-checkmark.test.tsx | 5 +- .../{__tests__ => }/reducer.test.ts | 8 +- .../{__tests__ => }/captcha.test.tsx | 5 +- .../{__tests__ => }/login-form.test.tsx | 4 +- .../{__tests__ => }/login-page.test.tsx | 4 +- .../{__tests__ => }/otp-auth-form.test.tsx | 5 +- .../password-reset-confirm.test.tsx | 4 +- .../{__tests__ => }/chat-list-item.test.tsx | 4 +- .../chat-message-list.test.tsx | 8 +- .../chat-message-reaction.test.tsx | 5 +- .../chat-page/__tests__/chat-page.test.tsx | 94 --------------- .../{__tests__ => }/chat-pane-header.test.tsx | 5 +- .../{__tests__ => }/chat-pane.test.tsx | 2 +- .../{__tests__ => }/chat-search.test.tsx | 4 +- .../{__tests__ => }/chat-widget.test.tsx | 4 +- .../components/__tests__/search.test.tsx | 32 ------ .../duration-selector.test.tsx | 5 +- .../emoji.test.ts => index.test.ts} | 2 +- .../emoji-index.test.ts => search.test.ts} | 2 +- .../group-action-button.test.tsx | 2 +- .../{__tests__ => }/group-header.test.tsx | 2 +- .../group-member-count.test.tsx | 2 +- .../group-member-list-item.test.tsx | 2 +- .../group-options-button.test.tsx | 2 +- .../{__tests__ => }/group-privacy.test.tsx | 2 +- .../group-relationship.test.tsx | 2 +- .../group-tag-list-item.test.tsx | 2 +- .../__tests__/pending-requests.test.tsx | 87 -------------- .../__tests__/pending-group-rows.test.tsx | 107 ------------------ .../{__tests__ => }/group-grid-item.test.tsx | 2 +- .../{__tests__ => }/group-list-item.test.tsx | 2 +- .../{__tests__ => }/layout-buttons.test.tsx | 2 +- .../search/__tests__/recent-searches.test.tsx | 82 -------------- .../{__tests__ => }/blankslate.test.tsx | 2 +- .../search/{__tests__ => }/results.test.tsx | 2 +- .../search/{__tests__ => }/search.test.tsx | 2 +- .../{__tests__ => }/tag-list-item.test.tsx | 2 +- .../groups/{__tests__ => }/discover.test.tsx | 2 +- .../{__tests__ => }/notification.test.tsx | 2 +- .../{__tests__ => }/compose-button.test.tsx | 2 +- .../{__tests__ => }/cta-banner.test.tsx | 4 +- .../landing-page-modal.test.tsx | 2 +- .../__tests__/report-modal.test.tsx | 77 ------------- .../unauthorized-modal.test.tsx | 2 +- .../{__tests__ => }/navbar.test.tsx | 2 +- .../{__tests__ => }/sign-up-panel.test.tsx | 2 +- .../{__tests__ => }/subscribe-button.test.tsx | 2 +- .../{__tests__ => }/trends-panel.test.tsx | 2 +- .../{__tests__ => }/useDimensions.test.ts | 4 +- .../{__tests__ => }/useGroupsPath.test.ts | 2 +- .../{__tests__ => }/account.test.ts | 2 +- .../{__tests__ => }/attachment.test.ts | 2 +- .../{__tests__ => }/chat-message.test.ts | 4 +- .../{__tests__ => }/instance.test.ts | 2 +- .../{__tests__ => }/mention.test.ts | 2 +- .../{__tests__ => }/notification.test.ts | 2 +- .../{__tests__ => }/soapbox-config.test.ts | 2 +- .../{__tests__ => }/status.test.ts | 2 +- src/queries/{__tests__ => }/chats.test.ts | 2 +- .../{__tests__ => }/relationships.test.ts | 2 +- .../{__tests__ => }/suggestions.test.ts | 2 +- src/queries/{__tests__ => }/trends.test.ts | 2 +- src/reducers/{__tests__ => }/admin.test.ts | 2 +- .../{__tests__ => }/announcements.test.ts | 2 +- src/reducers/{__tests__ => }/auth.test.ts | 2 +- src/reducers/{__tests__ => }/compose.test.ts | 2 +- src/reducers/{__tests__ => }/contexts.test.ts | 2 +- .../{__tests__ => }/conversations.test.ts | 2 +- .../{__tests__ => }/custom-emojis.test.ts | 2 +- .../{__tests__ => }/domain-lists.test.ts | 2 +- .../{__tests__ => }/dropdown-menu.test.ts | 2 +- src/reducers/{__tests__ => }/filters.test.ts | 2 +- src/reducers/{__tests__ => }/index.test.ts | 2 +- src/reducers/{__tests__ => }/instance.test.ts | 2 +- .../{__tests__ => }/list-adder.test.ts | 2 +- src/reducers/{__tests__ => }/lists.test.ts | 2 +- src/reducers/{__tests__ => }/me.test.ts | 2 +- src/reducers/{__tests__ => }/meta.test.ts | 2 +- src/reducers/{__tests__ => }/modals.test.ts | 2 +- src/reducers/{__tests__ => }/mutes.test.ts | 2 +- .../{__tests__ => }/onboarding.test.ts | 2 +- src/reducers/{__tests__ => }/polls.test.ts | 2 +- .../push-notifications.test.ts | 2 +- .../{__tests__ => }/relationships.test.ts | 6 +- src/reducers/{__tests__ => }/reports.test.ts | 2 +- src/reducers/{__tests__ => }/rules.test.ts | 2 +- src/reducers/{__tests__ => }/settings.test.ts | 2 +- src/reducers/{__tests__ => }/sidebar.test.ts | 2 +- src/reducers/{__tests__ => }/soapbox.test.ts | 2 +- .../status-hover-card.test.tsx | 2 +- .../{__tests__ => }/status-lists.test.ts | 2 +- src/reducers/{__tests__ => }/statuses.test.ts | 2 +- .../{__tests__ => }/suggestions.test.ts | 2 +- .../{__tests__ => }/timelines.test.ts | 2 +- src/reducers/{__tests__ => }/trends.test.ts | 2 +- .../{__tests__ => }/user-lists.test.ts | 2 +- src/schemas/{__tests__ => }/card.test.ts | 2 +- src/schemas/{__tests__ => }/group.test.ts | 2 +- src/schemas/{__tests__ => }/poll.test.ts | 2 +- src/{__tests__ => }/toast.test.tsx | 2 +- src/utils/{__tests__ => }/accounts.test.ts | 2 +- src/utils/{__tests__ => }/badges.test.ts | 2 +- src/utils/{__tests__ => }/base64.test.ts | 2 +- src/utils/{__tests__ => }/chats.test.ts | 2 +- src/utils/{__tests__ => }/colors.test.ts | 2 +- src/utils/{__tests__ => }/comparators.test.ts | 2 +- src/utils/{__tests__ => }/config-db.test.ts | 2 +- .../{__tests__ => }/emoji-reacts.test.ts | 2 +- src/utils/{__tests__ => }/emoji.test.ts | 2 +- src/utils/{__tests__ => }/features.test.ts | 2 +- src/utils/{__tests__ => }/html.test.ts | 2 +- src/utils/{__tests__ => }/input.test.ts | 2 +- src/utils/{__tests__ => }/media.test.ts | 2 +- src/utils/{__tests__ => }/numbers.test.tsx | 5 +- src/utils/{__tests__ => }/queries.test.ts | 2 +- src/utils/{__tests__ => }/status.test.ts | 2 +- src/utils/{__tests__ => }/tailwind.test.ts | 2 +- src/utils/{__tests__ => }/timelines.test.ts | 2 +- .../colors-test.js => colors.test.js} | 2 +- 160 files changed, 223 insertions(+), 681 deletions(-) rename src/actions/{__tests__ => }/about.test.ts (98%) rename src/actions/{__tests__ => }/account-notes.test.ts (96%) rename src/actions/{__tests__ => }/accounts.test.ts (99%) rename src/actions/{__tests__ => }/announcements.test.ts (100%) rename src/actions/{__tests__ => }/blocks.test.ts (98%) rename src/actions/{__tests__ => }/compose.test.ts (97%) rename src/actions/{__tests__ => }/me.test.ts (98%) rename src/actions/{__tests__ => }/notifications.test.ts (94%) rename src/actions/{__tests__ => }/onboarding.test.ts (99%) rename src/actions/{__tests__ => }/preload.test.ts (89%) rename src/actions/{__tests__ => }/rules.test.ts (97%) rename src/actions/{__tests__ => }/soapbox.test.ts (95%) rename src/actions/{__tests__ => }/status-quotes.test.ts (98%) rename src/actions/{__tests__ => }/statuses.test.ts (98%) rename src/api/hooks/groups/{__tests__ => }/useGroup.test.ts (96%) rename src/api/hooks/groups/{__tests__ => }/useGroupLookup.test.ts (95%) rename src/api/hooks/groups/{__tests__ => }/useGroupMedia.test.ts (96%) rename src/api/hooks/groups/{__tests__ => }/useGroupMembers.test.ts (96%) rename src/api/hooks/groups/{__tests__ => }/useGroups.test.ts (96%) rename src/api/hooks/groups/{__tests__ => }/usePendingGroups.test.ts (96%) rename src/components/{__tests__ => }/account.test.tsx (94%) rename src/components/{__tests__ => }/autosuggest-emoji.test.tsx (88%) rename src/components/{__tests__ => }/badge.test.tsx (71%) rename src/components/{__tests__ => }/display-name.test.tsx (77%) rename src/components/polls/{__tests__ => }/poll-footer.test.tsx (98%) rename src/components/{__tests__ => }/quoted-status.test.tsx (78%) rename src/components/{__tests__ => }/scroll-top-button.test.tsx (90%) rename src/components/{__tests__ => }/status.test.tsx (97%) rename src/components/statuses/{__tests__ => }/sensitive-content-overlay.test.tsx (96%) rename src/components/ui/avatar/{__tests__ => }/avatar.test.tsx (80%) rename src/components/ui/button/{__tests__ => }/button.test.tsx (95%) rename src/components/ui/card/{__tests__ => }/card.test.tsx (86%) rename src/components/ui/column/{__tests__ => }/column.test.tsx (68%) rename src/components/ui/datepicker/{__tests__ => }/datepicker.test.tsx (96%) rename src/components/ui/divider/{__tests__ => }/divider.test.tsx (79%) rename src/components/ui/emoji/{__tests__ => }/emoji.test.tsx (86%) rename src/components/ui/form-actions/{__tests__ => }/form-actions.test.tsx (70%) rename src/components/ui/form-group/{__tests__ => }/form-group.test.tsx (93%) rename src/components/ui/form/{__tests__ => }/form.test.tsx (84%) rename src/components/ui/icon/{__tests__ => }/svg-icon.test.tsx (81%) rename src/components/ui/modal/{__tests__ => }/modal.test.tsx (97%) rename src/components/{__tests__ => }/validation-checkmark.test.tsx (88%) rename src/entity-store/{__tests__ => }/reducer.test.ts (97%) rename src/features/auth-login/components/{__tests__ => }/captcha.test.tsx (85%) rename src/features/auth-login/components/{__tests__ => }/login-form.test.tsx (90%) rename src/features/auth-login/components/{__tests__ => }/login-page.test.tsx (93%) rename src/features/auth-login/components/{__tests__ => }/otp-auth-form.test.tsx (72%) rename src/features/auth-login/components/{__tests__ => }/password-reset-confirm.test.tsx (91%) rename src/features/chats/components/{__tests__ => }/chat-list-item.test.tsx (94%) rename src/features/chats/components/{__tests__ => }/chat-message-list.test.tsx (95%) rename src/features/chats/components/{__tests__ => }/chat-message-reaction.test.tsx (93%) delete mode 100644 src/features/chats/components/chat-page/__tests__/chat-page.test.tsx rename src/features/chats/components/{__tests__ => }/chat-pane-header.test.tsx (95%) rename src/features/chats/components/chat-pane/{__tests__ => }/chat-pane.test.tsx (98%) rename src/features/chats/components/chat-search/{__tests__ => }/chat-search.test.tsx (93%) rename src/features/chats/components/{__tests__ => }/chat-widget.test.tsx (95%) delete mode 100644 src/features/compose/components/__tests__/search.test.tsx rename src/features/compose/components/polls/{__tests__ => }/duration-selector.test.tsx (95%) rename src/features/emoji/{__tests__/emoji.test.ts => index.test.ts} (99%) rename src/features/emoji/{__tests__/emoji-index.test.ts => search.test.ts} (98%) rename src/features/group/components/{__tests__ => }/group-action-button.test.tsx (98%) rename src/features/group/components/{__tests__ => }/group-header.test.tsx (97%) rename src/features/group/components/{__tests__ => }/group-member-count.test.tsx (95%) rename src/features/group/components/{__tests__ => }/group-member-list-item.test.tsx (99%) rename src/features/group/components/{__tests__ => }/group-options-button.test.tsx (97%) rename src/features/group/components/{__tests__ => }/group-privacy.test.tsx (94%) rename src/features/group/components/{__tests__ => }/group-relationship.test.tsx (96%) rename src/features/group/components/{__tests__ => }/group-tag-list-item.test.tsx (98%) delete mode 100644 src/features/groups/__tests__/pending-requests.test.tsx delete mode 100644 src/features/groups/components/__tests__/pending-group-rows.test.tsx rename src/features/groups/components/discover/{__tests__ => }/group-grid-item.test.tsx (92%) rename src/features/groups/components/discover/{__tests__ => }/group-list-item.test.tsx (92%) rename src/features/groups/components/discover/{__tests__ => }/layout-buttons.test.tsx (95%) delete mode 100644 src/features/groups/components/discover/search/__tests__/recent-searches.test.tsx rename src/features/groups/components/discover/search/{__tests__ => }/blankslate.test.tsx (94%) rename src/features/groups/components/discover/search/{__tests__ => }/results.test.tsx (98%) rename src/features/groups/components/discover/search/{__tests__ => }/search.test.tsx (97%) rename src/features/groups/components/discover/{__tests__ => }/tag-list-item.test.tsx (91%) rename src/features/groups/{__tests__ => }/discover.test.tsx (98%) rename src/features/notifications/components/{__tests__ => }/notification.test.tsx (99%) rename src/features/ui/components/{__tests__ => }/compose-button.test.tsx (95%) rename src/features/ui/components/{__tests__ => }/cta-banner.test.tsx (87%) rename src/features/ui/components/modals/{__tests__ => }/landing-page-modal.test.tsx (93%) delete mode 100644 src/features/ui/components/modals/report-modal/__tests__/report-modal.test.tsx rename src/features/ui/components/modals/{__tests__ => }/unauthorized-modal.test.tsx (93%) rename src/features/ui/components/{__tests__ => }/navbar.test.tsx (95%) rename src/features/ui/components/panels/{__tests__ => }/sign-up-panel.test.tsx (92%) rename src/features/ui/components/{__tests__ => }/subscribe-button.test.tsx (92%) rename src/features/ui/components/{__tests__ => }/trends-panel.test.tsx (97%) rename src/hooks/{__tests__ => }/useDimensions.test.ts (91%) rename src/hooks/{__tests__ => }/useGroupsPath.test.ts (97%) rename src/normalizers/{__tests__ => }/account.test.ts (99%) rename src/normalizers/{__tests__ => }/attachment.test.ts (91%) rename src/normalizers/{__tests__ => }/chat-message.test.ts (85%) rename src/normalizers/{__tests__ => }/instance.test.ts (99%) rename src/normalizers/{__tests__ => }/mention.test.ts (92%) rename src/normalizers/{__tests__ => }/notification.test.ts (89%) rename src/normalizers/soapbox/{__tests__ => }/soapbox-config.test.ts (97%) rename src/normalizers/{__tests__ => }/status.test.ts (99%) rename src/queries/{__tests__ => }/chats.test.ts (99%) rename src/queries/{__tests__ => }/relationships.test.ts (98%) rename src/queries/{__tests__ => }/suggestions.test.ts (95%) rename src/queries/{__tests__ => }/trends.test.ts (97%) rename src/reducers/{__tests__ => }/admin.test.ts (90%) rename src/reducers/{__tests__ => }/announcements.test.ts (97%) rename src/reducers/{__tests__ => }/auth.test.ts (99%) rename src/reducers/{__tests__ => }/compose.test.ts (99%) rename src/reducers/{__tests__ => }/contexts.test.ts (98%) rename src/reducers/{__tests__ => }/conversations.test.ts (97%) rename src/reducers/{__tests__ => }/custom-emojis.test.ts (84%) rename src/reducers/{__tests__ => }/domain-lists.test.ts (85%) rename src/reducers/{__tests__ => }/dropdown-menu.test.ts (82%) rename src/reducers/{__tests__ => }/filters.test.ts (86%) rename src/reducers/{__tests__ => }/index.test.ts (92%) rename src/reducers/{__tests__ => }/instance.test.ts (99%) rename src/reducers/{__tests__ => }/list-adder.test.ts (98%) rename src/reducers/{__tests__ => }/lists.test.ts (86%) rename src/reducers/{__tests__ => }/me.test.ts (83%) rename src/reducers/{__tests__ => }/meta.test.ts (95%) rename src/reducers/{__tests__ => }/modals.test.ts (97%) rename src/reducers/{__tests__ => }/mutes.test.ts (97%) rename src/reducers/{__tests__ => }/onboarding.test.ts (95%) rename src/reducers/{__tests__ => }/polls.test.ts (96%) rename src/reducers/{__tests__ => }/push-notifications.test.ts (90%) rename src/reducers/{__tests__ => }/relationships.test.ts (91%) rename src/reducers/{__tests__ => }/reports.test.ts (92%) rename src/reducers/{__tests__ => }/rules.test.ts (96%) rename src/reducers/{__tests__ => }/settings.test.ts (87%) rename src/reducers/{__tests__ => }/sidebar.test.ts (83%) rename src/reducers/{__tests__ => }/soapbox.test.ts (97%) rename src/reducers/{__tests__ => }/status-hover-card.test.tsx (96%) rename src/reducers/{__tests__ => }/status-lists.test.ts (95%) rename src/reducers/{__tests__ => }/statuses.test.ts (99%) rename src/reducers/{__tests__ => }/suggestions.test.ts (96%) rename src/reducers/{__tests__ => }/timelines.test.ts (98%) rename src/reducers/{__tests__ => }/trends.test.ts (85%) rename src/reducers/{__tests__ => }/user-lists.test.ts (95%) rename src/schemas/{__tests__ => }/card.test.ts (86%) rename src/schemas/{__tests__ => }/group.test.ts (84%) rename src/schemas/{__tests__ => }/poll.test.ts (96%) rename src/{__tests__ => }/toast.test.tsx (98%) rename src/utils/{__tests__ => }/accounts.test.ts (94%) rename src/utils/{__tests__ => }/badges.test.ts (97%) rename src/utils/{__tests__ => }/base64.test.ts (85%) rename src/utils/{__tests__ => }/chats.test.ts (97%) rename src/utils/{__tests__ => }/colors.test.ts (92%) rename src/utils/{__tests__ => }/comparators.test.ts (76%) rename src/utils/{__tests__ => }/config-db.test.ts (90%) rename src/utils/{__tests__ => }/emoji-reacts.test.ts (99%) rename src/utils/{__tests__ => }/emoji.test.ts (98%) rename src/utils/{__tests__ => }/features.test.ts (99%) rename src/utils/{__tests__ => }/html.test.ts (88%) rename src/utils/{__tests__ => }/input.test.ts (83%) rename src/utils/{__tests__ => }/media.test.ts (98%) rename src/utils/{__tests__ => }/numbers.test.tsx (98%) rename src/utils/{__tests__ => }/queries.test.ts (99%) rename src/utils/{__tests__ => }/status.test.ts (98%) rename src/utils/{__tests__ => }/tailwind.test.ts (98%) rename src/utils/{__tests__ => }/timelines.test.ts (98%) rename tailwind/{__tests__/colors-test.js => colors.test.js} (98%) diff --git a/src/actions/__tests__/about.test.ts b/src/actions/about.test.ts similarity index 98% rename from src/actions/__tests__/about.test.ts rename to src/actions/about.test.ts index a0b042519..282e80c37 100644 --- a/src/actions/__tests__/about.test.ts +++ b/src/actions/about.test.ts @@ -9,7 +9,7 @@ import { FETCH_ABOUT_PAGE_SUCCESS, FETCH_ABOUT_PAGE_FAIL, fetchAboutPage, -} from '../about'; +} from './about'; describe('fetchAboutPage()', () => { it('creates the expected actions on success', () => { diff --git a/src/actions/__tests__/account-notes.test.ts b/src/actions/account-notes.test.ts similarity index 96% rename from src/actions/__tests__/account-notes.test.ts rename to src/actions/account-notes.test.ts index 53c1c85df..5cd45f26e 100644 --- a/src/actions/__tests__/account-notes.test.ts +++ b/src/actions/account-notes.test.ts @@ -1,7 +1,7 @@ import { __stub } from 'soapbox/api'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; -import { submitAccountNote } from '../account-notes'; +import { submitAccountNote } from './account-notes'; describe('submitAccountNote()', () => { let store: ReturnType; diff --git a/src/actions/__tests__/accounts.test.ts b/src/actions/accounts.test.ts similarity index 99% rename from src/actions/__tests__/accounts.test.ts rename to src/actions/accounts.test.ts index 9f264ab34..3d0c4deb8 100644 --- a/src/actions/__tests__/accounts.test.ts +++ b/src/actions/accounts.test.ts @@ -3,9 +3,9 @@ import { Map as ImmutableMap } from 'immutable'; import { __stub } from 'soapbox/api'; import { buildInstance, buildRelationship } from 'soapbox/jest/factory'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; +import { normalizeAccount } from 'soapbox/normalizers'; import { ListRecord, ReducerRecord } from 'soapbox/reducers/user-lists'; -import { normalizeAccount } from '../../normalizers'; import { authorizeFollowRequest, blockAccount, @@ -25,7 +25,7 @@ import { unblockAccount, unmuteAccount, unsubscribeAccount, -} from '../accounts'; +} from './accounts'; let store: ReturnType; diff --git a/src/actions/__tests__/announcements.test.ts b/src/actions/announcements.test.ts similarity index 100% rename from src/actions/__tests__/announcements.test.ts rename to src/actions/announcements.test.ts diff --git a/src/actions/__tests__/blocks.test.ts b/src/actions/blocks.test.ts similarity index 98% rename from src/actions/__tests__/blocks.test.ts rename to src/actions/blocks.test.ts index 49f649ab6..bfa67c4be 100644 --- a/src/actions/__tests__/blocks.test.ts +++ b/src/actions/blocks.test.ts @@ -2,7 +2,7 @@ import { __stub } from 'soapbox/api'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; import { ListRecord, ReducerRecord as UserListsRecord } from 'soapbox/reducers/user-lists'; -import { expandBlocks, fetchBlocks } from '../blocks'; +import { expandBlocks, fetchBlocks } from './blocks'; const account = { acct: 'twoods', diff --git a/src/actions/__tests__/compose.test.ts b/src/actions/compose.test.ts similarity index 97% rename from src/actions/__tests__/compose.test.ts rename to src/actions/compose.test.ts index 7026e3aab..c2141cbb0 100644 --- a/src/actions/__tests__/compose.test.ts +++ b/src/actions/compose.test.ts @@ -4,8 +4,8 @@ import { buildInstance } from 'soapbox/jest/factory'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; import { ReducerCompose } from 'soapbox/reducers/compose'; -import { uploadCompose, submitCompose } from '../compose'; -import { STATUS_CREATE_REQUEST } from '../statuses'; +import { uploadCompose, submitCompose } from './compose'; +import { STATUS_CREATE_REQUEST } from './statuses'; import type { IntlShape } from 'react-intl'; diff --git a/src/actions/__tests__/me.test.ts b/src/actions/me.test.ts similarity index 98% rename from src/actions/__tests__/me.test.ts rename to src/actions/me.test.ts index 375eee761..63f22eac4 100644 --- a/src/actions/__tests__/me.test.ts +++ b/src/actions/me.test.ts @@ -5,7 +5,7 @@ import { buildAccount } from 'soapbox/jest/factory'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; import { AuthUserRecord, ReducerRecord } from 'soapbox/reducers/auth'; -import { fetchMe, patchMe } from '../me'; +import { fetchMe, patchMe } from './me'; vi.mock('../../storage/kv-store', () => ({ __esModule: true, diff --git a/src/actions/__tests__/notifications.test.ts b/src/actions/notifications.test.ts similarity index 94% rename from src/actions/__tests__/notifications.test.ts rename to src/actions/notifications.test.ts index 5bc282add..0ead1491a 100644 --- a/src/actions/__tests__/notifications.test.ts +++ b/src/actions/notifications.test.ts @@ -4,7 +4,7 @@ import { __stub } from 'soapbox/api'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; import { normalizeNotification } from 'soapbox/normalizers'; -import { markReadNotifications } from '../notifications'; +import { markReadNotifications } from './notifications'; describe('markReadNotifications()', () => { it('fires off marker when top notification is newer than lastRead', async() => { diff --git a/src/actions/__tests__/onboarding.test.ts b/src/actions/onboarding.test.ts similarity index 99% rename from src/actions/__tests__/onboarding.test.ts rename to src/actions/onboarding.test.ts index 15a10f93a..dc91f8a03 100644 --- a/src/actions/__tests__/onboarding.test.ts +++ b/src/actions/onboarding.test.ts @@ -1,6 +1,6 @@ import { mockStore, mockWindowProperty, rootState } from 'soapbox/jest/test-helpers'; -import { checkOnboardingStatus, startOnboarding, endOnboarding } from '../onboarding'; +import { checkOnboardingStatus, startOnboarding, endOnboarding } from './onboarding'; describe('checkOnboarding()', () => { let mockGetItem: any; diff --git a/src/actions/__tests__/preload.test.ts b/src/actions/preload.test.ts similarity index 89% rename from src/actions/__tests__/preload.test.ts rename to src/actions/preload.test.ts index a15165164..029a8a833 100644 --- a/src/actions/__tests__/preload.test.ts +++ b/src/actions/preload.test.ts @@ -3,12 +3,12 @@ import { Map as ImmutableMap } from 'immutable'; import { __stub } from 'soapbox/api'; import { mockStore } from 'soapbox/jest/test-helpers'; -import { VERIFY_CREDENTIALS_REQUEST } from '../auth'; -import { ACCOUNTS_IMPORT } from '../importer'; +import { VERIFY_CREDENTIALS_REQUEST } from './auth'; +import { ACCOUNTS_IMPORT } from './importer'; import { MASTODON_PRELOAD_IMPORT, preloadMastodon, -} from '../preload'; +} from './preload'; describe('preloadMastodon()', () => { it('creates the expected actions', () => { diff --git a/src/actions/__tests__/rules.test.ts b/src/actions/rules.test.ts similarity index 97% rename from src/actions/__tests__/rules.test.ts rename to src/actions/rules.test.ts index 624e2dd0d..d25b54dbd 100644 --- a/src/actions/__tests__/rules.test.ts +++ b/src/actions/rules.test.ts @@ -1,7 +1,7 @@ import { __stub } from 'soapbox/api'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; -import { fetchRules, RULES_FETCH_REQUEST, RULES_FETCH_SUCCESS } from '../rules'; +import { fetchRules, RULES_FETCH_REQUEST, RULES_FETCH_SUCCESS } from './rules'; describe('fetchRules()', () => { it('sets the rules', async () => { diff --git a/src/actions/__tests__/soapbox.test.ts b/src/actions/soapbox.test.ts similarity index 95% rename from src/actions/__tests__/soapbox.test.ts rename to src/actions/soapbox.test.ts index 6247ab256..1a698a36c 100644 --- a/src/actions/__tests__/soapbox.test.ts +++ b/src/actions/soapbox.test.ts @@ -1,7 +1,7 @@ import { rootState } from 'soapbox/jest/test-helpers'; import { RootState } from 'soapbox/store'; -import { getSoapboxConfig } from '../soapbox'; +import { getSoapboxConfig } from './soapbox'; const ASCII_HEART = '❤'; // '\u2764\uFE0F' const RED_HEART_RGI = '❤️'; // '\u2764' diff --git a/src/actions/__tests__/status-quotes.test.ts b/src/actions/status-quotes.test.ts similarity index 98% rename from src/actions/__tests__/status-quotes.test.ts rename to src/actions/status-quotes.test.ts index 1e68dc882..1e18904a3 100644 --- a/src/actions/__tests__/status-quotes.test.ts +++ b/src/actions/status-quotes.test.ts @@ -4,7 +4,7 @@ import { __stub } from 'soapbox/api'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; import { StatusListRecord } from 'soapbox/reducers/status-lists'; -import { fetchStatusQuotes, expandStatusQuotes } from '../status-quotes'; +import { fetchStatusQuotes, expandStatusQuotes } from './status-quotes'; const status = { account: { diff --git a/src/actions/__tests__/statuses.test.ts b/src/actions/statuses.test.ts similarity index 98% rename from src/actions/__tests__/statuses.test.ts rename to src/actions/statuses.test.ts index 120d24807..8004a47ca 100644 --- a/src/actions/__tests__/statuses.test.ts +++ b/src/actions/statuses.test.ts @@ -5,7 +5,7 @@ import { __stub } from 'soapbox/api'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; import { normalizeStatus } from 'soapbox/normalizers/status'; -import { deleteStatus, fetchContext } from '../statuses'; +import { deleteStatus, fetchContext } from './statuses'; describe('fetchContext()', () => { it('handles Mitra context', async () => { diff --git a/src/api/hooks/groups/__tests__/useGroup.test.ts b/src/api/hooks/groups/useGroup.test.ts similarity index 96% rename from src/api/hooks/groups/__tests__/useGroup.test.ts rename to src/api/hooks/groups/useGroup.test.ts index 8afd06f1a..c6df44aab 100644 --- a/src/api/hooks/groups/__tests__/useGroup.test.ts +++ b/src/api/hooks/groups/useGroup.test.ts @@ -2,7 +2,7 @@ import { __stub } from 'soapbox/api'; import { buildGroup } from 'soapbox/jest/factory'; import { renderHook, waitFor } from 'soapbox/jest/test-helpers'; -import { useGroup } from '../useGroup'; +import { useGroup } from './useGroup'; const group = buildGroup({ id: '1', display_name: 'soapbox' }); diff --git a/src/api/hooks/groups/__tests__/useGroupLookup.test.ts b/src/api/hooks/groups/useGroupLookup.test.ts similarity index 95% rename from src/api/hooks/groups/__tests__/useGroupLookup.test.ts rename to src/api/hooks/groups/useGroupLookup.test.ts index 6723aee78..ce3903ae3 100644 --- a/src/api/hooks/groups/__tests__/useGroupLookup.test.ts +++ b/src/api/hooks/groups/useGroupLookup.test.ts @@ -2,7 +2,7 @@ import { __stub } from 'soapbox/api'; import { buildGroup } from 'soapbox/jest/factory'; import { renderHook, rootState, waitFor } from 'soapbox/jest/test-helpers'; -import { useGroupLookup } from '../useGroupLookup'; +import { useGroupLookup } from './useGroupLookup'; const group = buildGroup({ id: '1', slug: 'soapbox' }); const state = rootState.setIn(['instance', 'version'], '3.4.1 (compatible; TruthSocial 1.0.0)'); diff --git a/src/api/hooks/groups/__tests__/useGroupMedia.test.ts b/src/api/hooks/groups/useGroupMedia.test.ts similarity index 96% rename from src/api/hooks/groups/__tests__/useGroupMedia.test.ts rename to src/api/hooks/groups/useGroupMedia.test.ts index a68b79eb1..c38615c05 100644 --- a/src/api/hooks/groups/__tests__/useGroupMedia.test.ts +++ b/src/api/hooks/groups/useGroupMedia.test.ts @@ -2,7 +2,7 @@ import { __stub } from 'soapbox/api'; import { buildStatus } from 'soapbox/jest/factory'; import { renderHook, waitFor } from 'soapbox/jest/test-helpers'; -import { useGroupMedia } from '../useGroupMedia'; +import { useGroupMedia } from './useGroupMedia'; const status = buildStatus(); const groupId = '1'; diff --git a/src/api/hooks/groups/__tests__/useGroupMembers.test.ts b/src/api/hooks/groups/useGroupMembers.test.ts similarity index 96% rename from src/api/hooks/groups/__tests__/useGroupMembers.test.ts rename to src/api/hooks/groups/useGroupMembers.test.ts index 6f2fb6eac..d82133423 100644 --- a/src/api/hooks/groups/__tests__/useGroupMembers.test.ts +++ b/src/api/hooks/groups/useGroupMembers.test.ts @@ -3,7 +3,7 @@ import { buildGroupMember } from 'soapbox/jest/factory'; import { renderHook, waitFor } from 'soapbox/jest/test-helpers'; import { GroupRoles } from 'soapbox/schemas/group-member'; -import { useGroupMembers } from '../useGroupMembers'; +import { useGroupMembers } from './useGroupMembers'; const groupMember = buildGroupMember(); const groupId = '1'; diff --git a/src/api/hooks/groups/__tests__/useGroups.test.ts b/src/api/hooks/groups/useGroups.test.ts similarity index 96% rename from src/api/hooks/groups/__tests__/useGroups.test.ts rename to src/api/hooks/groups/useGroups.test.ts index 739a1c0af..950c4eb81 100644 --- a/src/api/hooks/groups/__tests__/useGroups.test.ts +++ b/src/api/hooks/groups/useGroups.test.ts @@ -3,7 +3,7 @@ import { buildGroup } from 'soapbox/jest/factory'; import { renderHook, waitFor } from 'soapbox/jest/test-helpers'; import { normalizeInstance } from 'soapbox/normalizers'; -import { useGroups } from '../useGroups'; +import { useGroups } from './useGroups'; const group = buildGroup({ id: '1', display_name: 'soapbox' }); const store = { diff --git a/src/api/hooks/groups/__tests__/usePendingGroups.test.ts b/src/api/hooks/groups/usePendingGroups.test.ts similarity index 96% rename from src/api/hooks/groups/__tests__/usePendingGroups.test.ts rename to src/api/hooks/groups/usePendingGroups.test.ts index c5b85fe28..f2f76178c 100644 --- a/src/api/hooks/groups/__tests__/usePendingGroups.test.ts +++ b/src/api/hooks/groups/usePendingGroups.test.ts @@ -4,7 +4,7 @@ import { buildAccount, buildGroup } from 'soapbox/jest/factory'; import { renderHook, waitFor } from 'soapbox/jest/test-helpers'; import { normalizeInstance } from 'soapbox/normalizers'; -import { usePendingGroups } from '../usePendingGroups'; +import { usePendingGroups } from './usePendingGroups'; const id = '1'; const group = buildGroup({ id, display_name: 'soapbox' }); diff --git a/src/components/__tests__/account.test.tsx b/src/components/account.test.tsx similarity index 94% rename from src/components/__tests__/account.test.tsx rename to src/components/account.test.tsx index c231fc533..306ff21a8 100644 --- a/src/components/__tests__/account.test.tsx +++ b/src/components/account.test.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { buildAccount } from 'soapbox/jest/factory'; +import { render, screen } from 'soapbox/jest/test-helpers'; -import { render, screen } from '../../jest/test-helpers'; -import Account from '../account'; +import Account from './account'; describe('', () => { it('renders account name and username', () => { diff --git a/src/components/__tests__/autosuggest-emoji.test.tsx b/src/components/autosuggest-emoji.test.tsx similarity index 88% rename from src/components/__tests__/autosuggest-emoji.test.tsx rename to src/components/autosuggest-emoji.test.tsx index e2f059ff7..38e45a370 100644 --- a/src/components/__tests__/autosuggest-emoji.test.tsx +++ b/src/components/autosuggest-emoji.test.tsx @@ -1,7 +1,8 @@ import React from 'react'; -import { render, screen } from '../../jest/test-helpers'; -import AutosuggestEmoji from '../autosuggest-emoji'; +import { render, screen } from 'soapbox/jest/test-helpers'; + +import AutosuggestEmoji from './autosuggest-emoji'; describe('', () => { it('renders native emoji', () => { diff --git a/src/components/__tests__/badge.test.tsx b/src/components/badge.test.tsx similarity index 71% rename from src/components/__tests__/badge.test.tsx rename to src/components/badge.test.tsx index 1de80285d..6204f7dcb 100644 --- a/src/components/__tests__/badge.test.tsx +++ b/src/components/badge.test.tsx @@ -1,7 +1,8 @@ import React from 'react'; -import { render, screen } from '../../jest/test-helpers'; -import Badge from '../badge'; +import { render, screen } from 'soapbox/jest/test-helpers'; + +import Badge from './badge'; describe('', () => { it('renders correctly', () => { diff --git a/src/components/__tests__/display-name.test.tsx b/src/components/display-name.test.tsx similarity index 77% rename from src/components/__tests__/display-name.test.tsx rename to src/components/display-name.test.tsx index 59ba65f19..7c819f637 100644 --- a/src/components/__tests__/display-name.test.tsx +++ b/src/components/display-name.test.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { buildAccount } from 'soapbox/jest/factory'; +import { render, screen } from 'soapbox/jest/test-helpers'; -import { render, screen } from '../../jest/test-helpers'; -import DisplayName from '../display-name'; +import DisplayName from './display-name'; describe('', () => { it('renders display name + account name', () => { diff --git a/src/components/polls/__tests__/poll-footer.test.tsx b/src/components/polls/poll-footer.test.tsx similarity index 98% rename from src/components/polls/__tests__/poll-footer.test.tsx rename to src/components/polls/poll-footer.test.tsx index a9e709399..0215d170a 100644 --- a/src/components/polls/__tests__/poll-footer.test.tsx +++ b/src/components/polls/poll-footer.test.tsx @@ -7,7 +7,7 @@ import { __stub } from 'soapbox/api'; import { mockStore, render, screen, rootState } from 'soapbox/jest/test-helpers'; import { type Poll } from 'soapbox/schemas'; -import PollFooter from '../poll-footer'; +import PollFooter from './poll-footer'; let poll: Poll = { id: '1', diff --git a/src/components/__tests__/quoted-status.test.tsx b/src/components/quoted-status.test.tsx similarity index 78% rename from src/components/__tests__/quoted-status.test.tsx rename to src/components/quoted-status.test.tsx index 05c906985..ca52fa126 100644 --- a/src/components/__tests__/quoted-status.test.tsx +++ b/src/components/quoted-status.test.tsx @@ -1,8 +1,9 @@ import React from 'react'; -import { render, screen, rootState } from '../../jest/test-helpers'; -import { normalizeStatus, normalizeAccount } from '../../normalizers'; -import QuotedStatus from '../quoted-status'; +import { render, screen, rootState } from 'soapbox/jest/test-helpers'; +import { normalizeStatus, normalizeAccount } from 'soapbox/normalizers'; + +import QuotedStatus from './quoted-status'; import type { ReducerStatus } from 'soapbox/reducers/statuses'; diff --git a/src/components/__tests__/scroll-top-button.test.tsx b/src/components/scroll-top-button.test.tsx similarity index 90% rename from src/components/__tests__/scroll-top-button.test.tsx rename to src/components/scroll-top-button.test.tsx index 76e6b7c1c..d016ade8f 100644 --- a/src/components/__tests__/scroll-top-button.test.tsx +++ b/src/components/scroll-top-button.test.tsx @@ -1,8 +1,9 @@ import React from 'react'; import { defineMessages } from 'react-intl'; -import { render, screen } from '../../jest/test-helpers'; -import ScrollTopButton from '../scroll-top-button'; +import { render, screen } from 'soapbox/jest/test-helpers'; + +import ScrollTopButton from './scroll-top-button'; const messages = defineMessages({ queue: { id: 'status_list.queue_label', defaultMessage: 'Click to see {count} new {count, plural, one {post} other {posts}}' }, diff --git a/src/components/__tests__/status.test.tsx b/src/components/status.test.tsx similarity index 97% rename from src/components/__tests__/status.test.tsx rename to src/components/status.test.tsx index d2ec39ca2..b1c2cdeab 100644 --- a/src/components/__tests__/status.test.tsx +++ b/src/components/status.test.tsx @@ -4,7 +4,7 @@ import { buildAccount } from 'soapbox/jest/factory'; import { render, screen, rootState } from 'soapbox/jest/test-helpers'; import { normalizeStatus } from 'soapbox/normalizers'; -import Status from '../status'; +import Status from './status'; import type { ReducerStatus } from 'soapbox/reducers/statuses'; diff --git a/src/components/statuses/__tests__/sensitive-content-overlay.test.tsx b/src/components/statuses/sensitive-content-overlay.test.tsx similarity index 96% rename from src/components/statuses/__tests__/sensitive-content-overlay.test.tsx rename to src/components/statuses/sensitive-content-overlay.test.tsx index ad677856e..4f93ef58c 100644 --- a/src/components/statuses/__tests__/sensitive-content-overlay.test.tsx +++ b/src/components/statuses/sensitive-content-overlay.test.tsx @@ -1,11 +1,11 @@ import { Map as ImmutableMap } from 'immutable'; import React from 'react'; +import { fireEvent, render, rootState, screen } from 'soapbox/jest/test-helpers'; import { normalizeStatus } from 'soapbox/normalizers'; import { ReducerStatus } from 'soapbox/reducers/statuses'; -import { fireEvent, render, rootState, screen } from '../../../jest/test-helpers'; -import SensitiveContentOverlay from '../sensitive-content-overlay'; +import SensitiveContentOverlay from './sensitive-content-overlay'; describe('', () => { let status: ReducerStatus; diff --git a/src/components/ui/avatar/__tests__/avatar.test.tsx b/src/components/ui/avatar/avatar.test.tsx similarity index 80% rename from src/components/ui/avatar/__tests__/avatar.test.tsx rename to src/components/ui/avatar/avatar.test.tsx index b46e5e029..6c958f0cb 100644 --- a/src/components/ui/avatar/__tests__/avatar.test.tsx +++ b/src/components/ui/avatar/avatar.test.tsx @@ -1,7 +1,8 @@ import React from 'react'; -import { render, screen } from '../../../../jest/test-helpers'; -import Avatar from '../avatar'; +import { render, screen } from 'soapbox/jest/test-helpers'; + +import Avatar from './avatar'; const src = '/static/alice.jpg'; diff --git a/src/components/ui/button/__tests__/button.test.tsx b/src/components/ui/button/button.test.tsx similarity index 95% rename from src/components/ui/button/__tests__/button.test.tsx rename to src/components/ui/button/button.test.tsx index f9c59c68a..5554caf0e 100644 --- a/src/components/ui/button/__tests__/button.test.tsx +++ b/src/components/ui/button/button.test.tsx @@ -1,7 +1,8 @@ import React from 'react'; -import { fireEvent, render, screen } from '../../../../jest/test-helpers'; -import Button from '../button'; +import { fireEvent, render, screen } from 'soapbox/jest/test-helpers'; + +import Button from './button'; describe('