Merge branch 'colocate-tests' into 'main'
Untuck tests out of __tests__ directories, colocate with program files See merge request soapbox-pub/soapbox!2774
This commit is contained in:
commit
1b199dfd9f
|
@ -9,7 +9,7 @@ import {
|
||||||
FETCH_ABOUT_PAGE_SUCCESS,
|
FETCH_ABOUT_PAGE_SUCCESS,
|
||||||
FETCH_ABOUT_PAGE_FAIL,
|
FETCH_ABOUT_PAGE_FAIL,
|
||||||
fetchAboutPage,
|
fetchAboutPage,
|
||||||
} from '../about';
|
} from './about';
|
||||||
|
|
||||||
describe('fetchAboutPage()', () => {
|
describe('fetchAboutPage()', () => {
|
||||||
it('creates the expected actions on success', () => {
|
it('creates the expected actions on success', () => {
|
|
@ -1,7 +1,7 @@
|
||||||
import { __stub } from 'soapbox/api';
|
import { __stub } from 'soapbox/api';
|
||||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import { submitAccountNote } from '../account-notes';
|
import { submitAccountNote } from './account-notes';
|
||||||
|
|
||||||
describe('submitAccountNote()', () => {
|
describe('submitAccountNote()', () => {
|
||||||
let store: ReturnType<typeof mockStore>;
|
let store: ReturnType<typeof mockStore>;
|
|
@ -3,9 +3,9 @@ import { Map as ImmutableMap } from 'immutable';
|
||||||
import { __stub } from 'soapbox/api';
|
import { __stub } from 'soapbox/api';
|
||||||
import { buildInstance, buildRelationship } from 'soapbox/jest/factory';
|
import { buildInstance, buildRelationship } from 'soapbox/jest/factory';
|
||||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||||
|
import { normalizeAccount } from 'soapbox/normalizers';
|
||||||
import { ListRecord, ReducerRecord } from 'soapbox/reducers/user-lists';
|
import { ListRecord, ReducerRecord } from 'soapbox/reducers/user-lists';
|
||||||
|
|
||||||
import { normalizeAccount } from '../../normalizers';
|
|
||||||
import {
|
import {
|
||||||
authorizeFollowRequest,
|
authorizeFollowRequest,
|
||||||
blockAccount,
|
blockAccount,
|
||||||
|
@ -25,7 +25,7 @@ import {
|
||||||
unblockAccount,
|
unblockAccount,
|
||||||
unmuteAccount,
|
unmuteAccount,
|
||||||
unsubscribeAccount,
|
unsubscribeAccount,
|
||||||
} from '../accounts';
|
} from './accounts';
|
||||||
|
|
||||||
let store: ReturnType<typeof mockStore>;
|
let store: ReturnType<typeof mockStore>;
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { __stub } from 'soapbox/api';
|
||||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||||
import { ListRecord, ReducerRecord as UserListsRecord } from 'soapbox/reducers/user-lists';
|
import { ListRecord, ReducerRecord as UserListsRecord } from 'soapbox/reducers/user-lists';
|
||||||
|
|
||||||
import { expandBlocks, fetchBlocks } from '../blocks';
|
import { expandBlocks, fetchBlocks } from './blocks';
|
||||||
|
|
||||||
const account = {
|
const account = {
|
||||||
acct: 'twoods',
|
acct: 'twoods',
|
|
@ -4,8 +4,8 @@ import { buildInstance } from 'soapbox/jest/factory';
|
||||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||||
import { ReducerCompose } from 'soapbox/reducers/compose';
|
import { ReducerCompose } from 'soapbox/reducers/compose';
|
||||||
|
|
||||||
import { uploadCompose, submitCompose } from '../compose';
|
import { uploadCompose, submitCompose } from './compose';
|
||||||
import { STATUS_CREATE_REQUEST } from '../statuses';
|
import { STATUS_CREATE_REQUEST } from './statuses';
|
||||||
|
|
||||||
import type { IntlShape } from 'react-intl';
|
import type { IntlShape } from 'react-intl';
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { buildAccount } from 'soapbox/jest/factory';
|
||||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||||
import { AuthUserRecord, ReducerRecord } from 'soapbox/reducers/auth';
|
import { AuthUserRecord, ReducerRecord } from 'soapbox/reducers/auth';
|
||||||
|
|
||||||
import { fetchMe, patchMe } from '../me';
|
import { fetchMe, patchMe } from './me';
|
||||||
|
|
||||||
vi.mock('../../storage/kv-store', () => ({
|
vi.mock('../../storage/kv-store', () => ({
|
||||||
__esModule: true,
|
__esModule: true,
|
|
@ -4,7 +4,7 @@ import { __stub } from 'soapbox/api';
|
||||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||||
import { normalizeNotification } from 'soapbox/normalizers';
|
import { normalizeNotification } from 'soapbox/normalizers';
|
||||||
|
|
||||||
import { markReadNotifications } from '../notifications';
|
import { markReadNotifications } from './notifications';
|
||||||
|
|
||||||
describe('markReadNotifications()', () => {
|
describe('markReadNotifications()', () => {
|
||||||
it('fires off marker when top notification is newer than lastRead', async() => {
|
it('fires off marker when top notification is newer than lastRead', async() => {
|
|
@ -1,6 +1,6 @@
|
||||||
import { mockStore, mockWindowProperty, rootState } from 'soapbox/jest/test-helpers';
|
import { mockStore, mockWindowProperty, rootState } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import { checkOnboardingStatus, startOnboarding, endOnboarding } from '../onboarding';
|
import { checkOnboardingStatus, startOnboarding, endOnboarding } from './onboarding';
|
||||||
|
|
||||||
describe('checkOnboarding()', () => {
|
describe('checkOnboarding()', () => {
|
||||||
let mockGetItem: any;
|
let mockGetItem: any;
|
|
@ -3,12 +3,12 @@ import { Map as ImmutableMap } from 'immutable';
|
||||||
import { __stub } from 'soapbox/api';
|
import { __stub } from 'soapbox/api';
|
||||||
import { mockStore } from 'soapbox/jest/test-helpers';
|
import { mockStore } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import { VERIFY_CREDENTIALS_REQUEST } from '../auth';
|
import { VERIFY_CREDENTIALS_REQUEST } from './auth';
|
||||||
import { ACCOUNTS_IMPORT } from '../importer';
|
import { ACCOUNTS_IMPORT } from './importer';
|
||||||
import {
|
import {
|
||||||
MASTODON_PRELOAD_IMPORT,
|
MASTODON_PRELOAD_IMPORT,
|
||||||
preloadMastodon,
|
preloadMastodon,
|
||||||
} from '../preload';
|
} from './preload';
|
||||||
|
|
||||||
describe('preloadMastodon()', () => {
|
describe('preloadMastodon()', () => {
|
||||||
it('creates the expected actions', () => {
|
it('creates the expected actions', () => {
|
|
@ -1,7 +1,7 @@
|
||||||
import { __stub } from 'soapbox/api';
|
import { __stub } from 'soapbox/api';
|
||||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
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()', () => {
|
describe('fetchRules()', () => {
|
||||||
it('sets the rules', async () => {
|
it('sets the rules', async () => {
|
|
@ -1,7 +1,7 @@
|
||||||
import { rootState } from 'soapbox/jest/test-helpers';
|
import { rootState } from 'soapbox/jest/test-helpers';
|
||||||
import { RootState } from 'soapbox/store';
|
import { RootState } from 'soapbox/store';
|
||||||
|
|
||||||
import { getSoapboxConfig } from '../soapbox';
|
import { getSoapboxConfig } from './soapbox';
|
||||||
|
|
||||||
const ASCII_HEART = '❤'; // '\u2764\uFE0F'
|
const ASCII_HEART = '❤'; // '\u2764\uFE0F'
|
||||||
const RED_HEART_RGI = '❤️'; // '\u2764'
|
const RED_HEART_RGI = '❤️'; // '\u2764'
|
|
@ -4,7 +4,7 @@ import { __stub } from 'soapbox/api';
|
||||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||||
import { StatusListRecord } from 'soapbox/reducers/status-lists';
|
import { StatusListRecord } from 'soapbox/reducers/status-lists';
|
||||||
|
|
||||||
import { fetchStatusQuotes, expandStatusQuotes } from '../status-quotes';
|
import { fetchStatusQuotes, expandStatusQuotes } from './status-quotes';
|
||||||
|
|
||||||
const status = {
|
const status = {
|
||||||
account: {
|
account: {
|
|
@ -5,7 +5,7 @@ import { __stub } from 'soapbox/api';
|
||||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||||
import { normalizeStatus } from 'soapbox/normalizers/status';
|
import { normalizeStatus } from 'soapbox/normalizers/status';
|
||||||
|
|
||||||
import { deleteStatus, fetchContext } from '../statuses';
|
import { deleteStatus, fetchContext } from './statuses';
|
||||||
|
|
||||||
describe('fetchContext()', () => {
|
describe('fetchContext()', () => {
|
||||||
it('handles Mitra context', async () => {
|
it('handles Mitra context', async () => {
|
|
@ -2,7 +2,7 @@ import { __stub } from 'soapbox/api';
|
||||||
import { buildGroup } from 'soapbox/jest/factory';
|
import { buildGroup } from 'soapbox/jest/factory';
|
||||||
import { renderHook, waitFor } from 'soapbox/jest/test-helpers';
|
import { renderHook, waitFor } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import { useGroup } from '../useGroup';
|
import { useGroup } from './useGroup';
|
||||||
|
|
||||||
const group = buildGroup({ id: '1', display_name: 'soapbox' });
|
const group = buildGroup({ id: '1', display_name: 'soapbox' });
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { __stub } from 'soapbox/api';
|
||||||
import { buildGroup } from 'soapbox/jest/factory';
|
import { buildGroup } from 'soapbox/jest/factory';
|
||||||
import { renderHook, rootState, waitFor } from 'soapbox/jest/test-helpers';
|
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 group = buildGroup({ id: '1', slug: 'soapbox' });
|
||||||
const state = rootState.setIn(['instance', 'version'], '3.4.1 (compatible; TruthSocial 1.0.0)');
|
const state = rootState.setIn(['instance', 'version'], '3.4.1 (compatible; TruthSocial 1.0.0)');
|
|
@ -2,7 +2,7 @@ import { __stub } from 'soapbox/api';
|
||||||
import { buildStatus } from 'soapbox/jest/factory';
|
import { buildStatus } from 'soapbox/jest/factory';
|
||||||
import { renderHook, waitFor } from 'soapbox/jest/test-helpers';
|
import { renderHook, waitFor } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import { useGroupMedia } from '../useGroupMedia';
|
import { useGroupMedia } from './useGroupMedia';
|
||||||
|
|
||||||
const status = buildStatus();
|
const status = buildStatus();
|
||||||
const groupId = '1';
|
const groupId = '1';
|
|
@ -3,7 +3,7 @@ import { buildGroupMember } from 'soapbox/jest/factory';
|
||||||
import { renderHook, waitFor } from 'soapbox/jest/test-helpers';
|
import { renderHook, waitFor } from 'soapbox/jest/test-helpers';
|
||||||
import { GroupRoles } from 'soapbox/schemas/group-member';
|
import { GroupRoles } from 'soapbox/schemas/group-member';
|
||||||
|
|
||||||
import { useGroupMembers } from '../useGroupMembers';
|
import { useGroupMembers } from './useGroupMembers';
|
||||||
|
|
||||||
const groupMember = buildGroupMember();
|
const groupMember = buildGroupMember();
|
||||||
const groupId = '1';
|
const groupId = '1';
|
|
@ -3,7 +3,7 @@ import { buildGroup } from 'soapbox/jest/factory';
|
||||||
import { renderHook, waitFor } from 'soapbox/jest/test-helpers';
|
import { renderHook, waitFor } from 'soapbox/jest/test-helpers';
|
||||||
import { normalizeInstance } from 'soapbox/normalizers';
|
import { normalizeInstance } from 'soapbox/normalizers';
|
||||||
|
|
||||||
import { useGroups } from '../useGroups';
|
import { useGroups } from './useGroups';
|
||||||
|
|
||||||
const group = buildGroup({ id: '1', display_name: 'soapbox' });
|
const group = buildGroup({ id: '1', display_name: 'soapbox' });
|
||||||
const store = {
|
const store = {
|
|
@ -4,7 +4,7 @@ import { buildAccount, buildGroup } from 'soapbox/jest/factory';
|
||||||
import { renderHook, waitFor } from 'soapbox/jest/test-helpers';
|
import { renderHook, waitFor } from 'soapbox/jest/test-helpers';
|
||||||
import { normalizeInstance } from 'soapbox/normalizers';
|
import { normalizeInstance } from 'soapbox/normalizers';
|
||||||
|
|
||||||
import { usePendingGroups } from '../usePendingGroups';
|
import { usePendingGroups } from './usePendingGroups';
|
||||||
|
|
||||||
const id = '1';
|
const id = '1';
|
||||||
const group = buildGroup({ id, display_name: 'soapbox' });
|
const group = buildGroup({ id, display_name: 'soapbox' });
|
|
@ -1,9 +1,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { buildAccount } from 'soapbox/jest/factory';
|
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('<Account />', () => {
|
describe('<Account />', () => {
|
||||||
it('renders account name and username', () => {
|
it('renders account name and username', () => {
|
|
@ -1,7 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { render, screen } from '../../jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import AutosuggestEmoji from '../autosuggest-emoji';
|
|
||||||
|
import AutosuggestEmoji from './autosuggest-emoji';
|
||||||
|
|
||||||
describe('<AutosuggestEmoji />', () => {
|
describe('<AutosuggestEmoji />', () => {
|
||||||
it('renders native emoji', () => {
|
it('renders native emoji', () => {
|
|
@ -1,7 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { render, screen } from '../../jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import Badge from '../badge';
|
|
||||||
|
import Badge from './badge';
|
||||||
|
|
||||||
describe('<Badge />', () => {
|
describe('<Badge />', () => {
|
||||||
it('renders correctly', () => {
|
it('renders correctly', () => {
|
|
@ -1,9 +1,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { buildAccount } from 'soapbox/jest/factory';
|
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('<DisplayName />', () => {
|
describe('<DisplayName />', () => {
|
||||||
it('renders display name + account name', () => {
|
it('renders display name + account name', () => {
|
|
@ -7,7 +7,7 @@ import { __stub } from 'soapbox/api';
|
||||||
import { mockStore, render, screen, rootState } from 'soapbox/jest/test-helpers';
|
import { mockStore, render, screen, rootState } from 'soapbox/jest/test-helpers';
|
||||||
import { type Poll } from 'soapbox/schemas';
|
import { type Poll } from 'soapbox/schemas';
|
||||||
|
|
||||||
import PollFooter from '../poll-footer';
|
import PollFooter from './poll-footer';
|
||||||
|
|
||||||
let poll: Poll = {
|
let poll: Poll = {
|
||||||
id: '1',
|
id: '1',
|
|
@ -1,8 +1,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { render, screen, rootState } from '../../jest/test-helpers';
|
import { render, screen, rootState } from 'soapbox/jest/test-helpers';
|
||||||
import { normalizeStatus, normalizeAccount } from '../../normalizers';
|
import { normalizeStatus, normalizeAccount } from 'soapbox/normalizers';
|
||||||
import QuotedStatus from '../quoted-status';
|
|
||||||
|
import QuotedStatus from './quoted-status';
|
||||||
|
|
||||||
import type { ReducerStatus } from 'soapbox/reducers/statuses';
|
import type { ReducerStatus } from 'soapbox/reducers/statuses';
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { defineMessages } from 'react-intl';
|
import { defineMessages } from 'react-intl';
|
||||||
|
|
||||||
import { render, screen } from '../../jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import ScrollTopButton from '../scroll-top-button';
|
|
||||||
|
import ScrollTopButton from './scroll-top-button';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
queue: { id: 'status_list.queue_label', defaultMessage: 'Click to see {count} new {count, plural, one {post} other {posts}}' },
|
queue: { id: 'status_list.queue_label', defaultMessage: 'Click to see {count} new {count, plural, one {post} other {posts}}' },
|
|
@ -4,7 +4,7 @@ import { buildAccount } from 'soapbox/jest/factory';
|
||||||
import { render, screen, rootState } from 'soapbox/jest/test-helpers';
|
import { render, screen, rootState } from 'soapbox/jest/test-helpers';
|
||||||
import { normalizeStatus } from 'soapbox/normalizers';
|
import { normalizeStatus } from 'soapbox/normalizers';
|
||||||
|
|
||||||
import Status from '../status';
|
import Status from './status';
|
||||||
|
|
||||||
import type { ReducerStatus } from 'soapbox/reducers/statuses';
|
import type { ReducerStatus } from 'soapbox/reducers/statuses';
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import { Map as ImmutableMap } from 'immutable';
|
import { Map as ImmutableMap } from 'immutable';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import { fireEvent, render, rootState, screen } from 'soapbox/jest/test-helpers';
|
||||||
import { normalizeStatus } from 'soapbox/normalizers';
|
import { normalizeStatus } from 'soapbox/normalizers';
|
||||||
import { ReducerStatus } from 'soapbox/reducers/statuses';
|
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('<SensitiveContentOverlay />', () => {
|
describe('<SensitiveContentOverlay />', () => {
|
||||||
let status: ReducerStatus;
|
let status: ReducerStatus;
|
|
@ -1,7 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { render, screen } from '../../../../jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import Avatar from '../avatar';
|
|
||||||
|
import Avatar from './avatar';
|
||||||
|
|
||||||
const src = '/static/alice.jpg';
|
const src = '/static/alice.jpg';
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { fireEvent, render, screen } from '../../../../jest/test-helpers';
|
import { fireEvent, render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import Button from '../button';
|
|
||||||
|
import Button from './button';
|
||||||
|
|
||||||
describe('<Button />', () => {
|
describe('<Button />', () => {
|
||||||
it('renders the given text', () => {
|
it('renders the given text', () => {
|
|
@ -1,7 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { render, screen } from '../../../../jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import { Card, CardBody, CardHeader, CardTitle } from '../card';
|
|
||||||
|
import { Card, CardBody, CardHeader, CardTitle } from './card';
|
||||||
|
|
||||||
describe('<Card />', () => {
|
describe('<Card />', () => {
|
||||||
it('renders the CardTitle and CardBody', () => {
|
it('renders the CardTitle and CardBody', () => {
|
|
@ -1,7 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { render, screen } from '../../../../jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import { Column } from '../column';
|
|
||||||
|
import { Column } from './column';
|
||||||
|
|
||||||
describe('<Column />', () => {
|
describe('<Column />', () => {
|
||||||
it('renders correctly with minimal props', () => {
|
it('renders correctly with minimal props', () => {
|
|
@ -1,8 +1,9 @@
|
||||||
import userEvent from '@testing-library/user-event';
|
import userEvent from '@testing-library/user-event';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { queryAllByRole, render, screen } from '../../../../jest/test-helpers';
|
import { queryAllByRole, render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import Datepicker from '../datepicker';
|
|
||||||
|
import Datepicker from './datepicker';
|
||||||
|
|
||||||
describe('<Datepicker />', () => {
|
describe('<Datepicker />', () => {
|
||||||
it('defaults to the current date', () => {
|
it('defaults to the current date', () => {
|
|
@ -1,7 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { render, screen } from '../../../../jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import Divider from '../divider';
|
|
||||||
|
import Divider from './divider';
|
||||||
|
|
||||||
describe('<Divider />', () => {
|
describe('<Divider />', () => {
|
||||||
it('renders without text', () => {
|
it('renders without text', () => {
|
|
@ -1,7 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { render, screen } from '../../../../jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import Emoji from '../emoji';
|
|
||||||
|
import Emoji from './emoji';
|
||||||
|
|
||||||
describe('<Emoji />', () => {
|
describe('<Emoji />', () => {
|
||||||
it('renders a simple emoji', () => {
|
it('renders a simple emoji', () => {
|
|
@ -1,7 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { render, screen } from '../../../../jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import FormActions from '../form-actions';
|
|
||||||
|
import FormActions from './form-actions';
|
||||||
|
|
||||||
describe('<FormActions />', () => {
|
describe('<FormActions />', () => {
|
||||||
it('renders successfully', () => {
|
it('renders successfully', () => {
|
|
@ -1,7 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { render, screen } from '../../../../jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import FormGroup from '../form-group';
|
|
||||||
|
import FormGroup from './form-group';
|
||||||
|
|
||||||
describe('<FormGroup />', () => {
|
describe('<FormGroup />', () => {
|
||||||
it('connects the label and input', () => {
|
it('connects the label and input', () => {
|
|
@ -1,7 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { fireEvent, render, screen } from '../../../../jest/test-helpers';
|
import { fireEvent, render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import Form from '../form';
|
|
||||||
|
import Form from './form';
|
||||||
|
|
||||||
describe('<Form />', () => {
|
describe('<Form />', () => {
|
||||||
it('renders children', () => {
|
it('renders children', () => {
|
|
@ -1,7 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { render, screen } from '../../../../jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import SvgIcon from '../svg-icon';
|
|
||||||
|
import SvgIcon from './svg-icon';
|
||||||
|
|
||||||
describe('<SvgIcon />', () => {
|
describe('<SvgIcon />', () => {
|
||||||
it('renders loading element with default size', () => {
|
it('renders loading element with default size', () => {
|
|
@ -1,8 +1,9 @@
|
||||||
import userEvent from '@testing-library/user-event';
|
import userEvent from '@testing-library/user-event';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { render, screen } from '../../../../jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import Modal from '../modal';
|
|
||||||
|
import Modal from './modal';
|
||||||
|
|
||||||
describe('<Modal />', () => {
|
describe('<Modal />', () => {
|
||||||
it('renders', () => {
|
it('renders', () => {
|
|
@ -1,7 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { render, screen } from '../../jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import ValidationCheckmark from '../validation-checkmark';
|
|
||||||
|
import ValidationCheckmark from './validation-checkmark';
|
||||||
|
|
||||||
describe('<ValidationCheckmark />', () => {
|
describe('<ValidationCheckmark />', () => {
|
||||||
it('renders text', () => {
|
it('renders text', () => {
|
|
@ -6,11 +6,11 @@ import {
|
||||||
entitiesFetchSuccess,
|
entitiesFetchSuccess,
|
||||||
importEntities,
|
importEntities,
|
||||||
incrementEntities,
|
incrementEntities,
|
||||||
} from '../actions';
|
} from './actions';
|
||||||
import reducer, { State } from '../reducer';
|
import reducer, { State } from './reducer';
|
||||||
import { createListState } from '../utils';
|
import { createListState } from './utils';
|
||||||
|
|
||||||
import type { EntityCache } from '../types';
|
import type { EntityCache } from './types';
|
||||||
|
|
||||||
interface TestEntity {
|
interface TestEntity {
|
||||||
id: string;
|
id: string;
|
|
@ -1,8 +1,9 @@
|
||||||
import { Map as ImmutableMap } from 'immutable';
|
import { Map as ImmutableMap } from 'immutable';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { render, screen } from '../../../../jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import CaptchaField, { NativeCaptchaField } from '../captcha';
|
|
||||||
|
import CaptchaField, { NativeCaptchaField } from './captcha';
|
||||||
|
|
||||||
describe('<CaptchaField />', () => {
|
describe('<CaptchaField />', () => {
|
||||||
it('renders null by default', () => {
|
it('renders null by default', () => {
|
|
@ -1,9 +1,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import { fireEvent, render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import { normalizeInstance } from 'soapbox/normalizers';
|
import { normalizeInstance } from 'soapbox/normalizers';
|
||||||
|
|
||||||
import { fireEvent, render, screen } from '../../../../jest/test-helpers';
|
import LoginForm from './login-form';
|
||||||
import LoginForm from '../login-form';
|
|
||||||
|
|
||||||
describe('<LoginForm />', () => {
|
describe('<LoginForm />', () => {
|
||||||
it('renders for Pleroma', () => {
|
it('renders for Pleroma', () => {
|
|
@ -1,9 +1,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import { normalizeInstance } from 'soapbox/normalizers';
|
import { normalizeInstance } from 'soapbox/normalizers';
|
||||||
|
|
||||||
import { render, screen } from '../../../../jest/test-helpers';
|
import LoginPage from './login-page';
|
||||||
import LoginPage from '../login-page';
|
|
||||||
|
|
||||||
describe('<LoginPage />', () => {
|
describe('<LoginPage />', () => {
|
||||||
it('renders correctly on load', () => {
|
it('renders correctly on load', () => {
|
|
@ -1,7 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { render, screen } from '../../../../jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import OtpAuthForm from '../otp-auth-form';
|
|
||||||
|
import OtpAuthForm from './otp-auth-form';
|
||||||
|
|
||||||
describe('<OtpAuthForm />', () => {
|
describe('<OtpAuthForm />', () => {
|
||||||
it('renders correctly', () => {
|
it('renders correctly', () => {
|
|
@ -2,9 +2,9 @@ import React from 'react';
|
||||||
import { Route, Switch } from 'react-router-dom';
|
import { Route, Switch } from 'react-router-dom';
|
||||||
|
|
||||||
import { __stub } from 'soapbox/api';
|
import { __stub } from 'soapbox/api';
|
||||||
|
import { fireEvent, render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import { fireEvent, render, screen, waitFor } from '../../../../jest/test-helpers';
|
import PasswordResetConfirm from './password-reset-confirm';
|
||||||
import PasswordResetConfirm from '../password-reset-confirm';
|
|
||||||
|
|
||||||
const TestableComponent = () => (
|
const TestableComponent = () => (
|
||||||
<Switch>
|
<Switch>
|
|
@ -1,9 +1,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import { IChat } from 'soapbox/queries/chats';
|
import { IChat } from 'soapbox/queries/chats';
|
||||||
|
|
||||||
import { render, screen } from '../../../../jest/test-helpers';
|
import ChatListItem from './chat-list-item';
|
||||||
import ChatListItem from '../chat-list-item';
|
|
||||||
|
|
||||||
const chat: any = {
|
const chat: any = {
|
||||||
id: '1',
|
id: '1',
|
|
@ -2,15 +2,15 @@ import userEvent from '@testing-library/user-event';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { VirtuosoMockContext } from 'react-virtuoso';
|
import { VirtuosoMockContext } from 'react-virtuoso';
|
||||||
|
|
||||||
|
import { __stub } from 'soapbox/api';
|
||||||
import { ChatContext } from 'soapbox/contexts/chat-context';
|
import { ChatContext } from 'soapbox/contexts/chat-context';
|
||||||
import { buildAccount, buildInstance } from 'soapbox/jest/factory';
|
import { buildAccount, buildInstance } from 'soapbox/jest/factory';
|
||||||
|
import { queryClient, render, rootState, screen, waitFor } from 'soapbox/jest/test-helpers';
|
||||||
import { normalizeChatMessage } from 'soapbox/normalizers';
|
import { normalizeChatMessage } from 'soapbox/normalizers';
|
||||||
|
import { IChat } from 'soapbox/queries/chats';
|
||||||
import { ChatMessage } from 'soapbox/types/entities';
|
import { ChatMessage } from 'soapbox/types/entities';
|
||||||
|
|
||||||
import { __stub } from '../../../../api';
|
import ChatMessageList from './chat-message-list';
|
||||||
import { queryClient, render, rootState, screen, waitFor } from '../../../../jest/test-helpers';
|
|
||||||
import { IChat } from '../../../../queries/chats';
|
|
||||||
import ChatMessageList from '../chat-message-list';
|
|
||||||
|
|
||||||
const chat: IChat = {
|
const chat: IChat = {
|
||||||
accepted: true,
|
accepted: true,
|
|
@ -1,8 +1,9 @@
|
||||||
import userEvent from '@testing-library/user-event';
|
import userEvent from '@testing-library/user-event';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { render, screen } from '../../../../jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import ChatMessageReaction from '../chat-message-reaction';
|
|
||||||
|
import ChatMessageReaction from './chat-message-reaction';
|
||||||
|
|
||||||
const emojiReaction = ({
|
const emojiReaction = ({
|
||||||
name: '👍',
|
name: '👍',
|
|
@ -1,94 +0,0 @@
|
||||||
test.skip('skip', () => {});
|
|
||||||
|
|
||||||
// import userEvent from '@testing-library/user-event';
|
|
||||||
// import React from 'react';
|
|
||||||
|
|
||||||
// import { __stub } from 'soapbox/api';
|
|
||||||
// import { buildAccount } from 'soapbox/jest/factory';
|
|
||||||
// import { render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
|
||||||
|
|
||||||
// import ChatPage from '../chat-page';
|
|
||||||
|
|
||||||
// describe('<ChatPage />', () => {
|
|
||||||
// let store: any;
|
|
||||||
|
|
||||||
// describe('before you finish onboarding', () => {
|
|
||||||
// it('renders the Welcome component', () => {
|
|
||||||
// render(<ChatPage />);
|
|
||||||
|
|
||||||
// expect(screen.getByTestId('chats-welcome')).toBeInTheDocument();
|
|
||||||
// });
|
|
||||||
|
|
||||||
// describe('when you complete onboarding', () => {
|
|
||||||
// const id = '1';
|
|
||||||
|
|
||||||
// beforeEach(() => {
|
|
||||||
// store = {
|
|
||||||
// me: id,
|
|
||||||
// accounts: {
|
|
||||||
// [id]: buildAccount({
|
|
||||||
// id,
|
|
||||||
// acct: 'justin-username',
|
|
||||||
// display_name: 'Justin L',
|
|
||||||
// avatar: 'test.jpg',
|
|
||||||
// source: {
|
|
||||||
// chats_onboarded: false,
|
|
||||||
// },
|
|
||||||
// }),
|
|
||||||
// },
|
|
||||||
// };
|
|
||||||
|
|
||||||
// __stub((mock) => {
|
|
||||||
// mock
|
|
||||||
// .onPatch('/api/v1/accounts/update_credentials')
|
|
||||||
// .reply(200, { chats_onboarded: true, id });
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
// it('renders the Chats', async () => {
|
|
||||||
// render(<ChatPage />, undefined, store);
|
|
||||||
// await userEvent.click(screen.getByTestId('button'));
|
|
||||||
|
|
||||||
// expect(screen.getByTestId('chat-page')).toBeInTheDocument();
|
|
||||||
|
|
||||||
// await waitFor(() => {
|
|
||||||
// expect(screen.getByTestId('toast')).toHaveTextContent('Chat Settings updated successfully');
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
// describe('when the API returns an error', () => {
|
|
||||||
// beforeEach(() => {
|
|
||||||
// store = {
|
|
||||||
// me: '1',
|
|
||||||
// accounts: {
|
|
||||||
// '1': buildAccount({
|
|
||||||
// id: '1',
|
|
||||||
// acct: 'justin-username',
|
|
||||||
// display_name: 'Justin L',
|
|
||||||
// avatar: 'test.jpg',
|
|
||||||
// source: {
|
|
||||||
// chats_onboarded: false,
|
|
||||||
// },
|
|
||||||
// }),
|
|
||||||
// },
|
|
||||||
// };
|
|
||||||
|
|
||||||
// __stub((mock) => {
|
|
||||||
// mock
|
|
||||||
// .onPatch('/api/v1/accounts/update_credentials')
|
|
||||||
// .networkError();
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
// it('renders the Chats', async () => {
|
|
||||||
// render(<ChatPage />, undefined, store);
|
|
||||||
// await userEvent.click(screen.getByTestId('button'));
|
|
||||||
|
|
||||||
// await waitFor(() => {
|
|
||||||
// expect(screen.getByTestId('toast')).toHaveTextContent('Chat Settings failed to update.');
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
|
@ -1,8 +1,9 @@
|
||||||
import userEvent from '@testing-library/user-event';
|
import userEvent from '@testing-library/user-event';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { render, screen } from '../../../../jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import ChatPaneHeader from '../chat-widget/chat-pane-header';
|
|
||||||
|
import ChatPaneHeader from './chat-widget/chat-pane-header';
|
||||||
|
|
||||||
describe('<ChatPaneHeader />', () => {
|
describe('<ChatPaneHeader />', () => {
|
||||||
it('handles the onToggle prop', async () => {
|
it('handles the onToggle prop', async () => {
|
|
@ -7,7 +7,7 @@ import { StatProvider } from 'soapbox/contexts/stat-context';
|
||||||
import chats from 'soapbox/jest/fixtures/chats.json';
|
import chats from 'soapbox/jest/fixtures/chats.json';
|
||||||
import { render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
import { render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import ChatPane from '../chat-pane';
|
import ChatPane from './chat-pane';
|
||||||
|
|
||||||
const renderComponentWithChatContext = (store = {}) => render(
|
const renderComponentWithChatContext = (store = {}) => render(
|
||||||
<VirtuosoMockContext.Provider value={{ viewportHeight: 300, itemHeight: 100 }}>
|
<VirtuosoMockContext.Provider value={{ viewportHeight: 300, itemHeight: 100 }}>
|
|
@ -4,9 +4,9 @@ import { VirtuosoMockContext } from 'react-virtuoso';
|
||||||
|
|
||||||
import { __stub } from 'soapbox/api';
|
import { __stub } from 'soapbox/api';
|
||||||
import { ChatProvider } from 'soapbox/contexts/chat-context';
|
import { ChatProvider } from 'soapbox/contexts/chat-context';
|
||||||
|
import { render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import { render, screen, waitFor } from '../../../../../jest/test-helpers';
|
import ChatSearch from './chat-search';
|
||||||
import ChatSearch from '../chat-search';
|
|
||||||
|
|
||||||
const renderComponent = () => render(
|
const renderComponent = () => render(
|
||||||
<VirtuosoMockContext.Provider value={{ viewportHeight: 300, itemHeight: 100 }}>
|
<VirtuosoMockContext.Provider value={{ viewportHeight: 300, itemHeight: 100 }}>
|
|
@ -2,9 +2,9 @@ import React from 'react';
|
||||||
import { Route, Switch } from 'react-router-dom';
|
import { Route, Switch } from 'react-router-dom';
|
||||||
|
|
||||||
import { buildAccount } from 'soapbox/jest/factory';
|
import { buildAccount } from 'soapbox/jest/factory';
|
||||||
|
import { render, rootState } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import { render, rootState } from '../../../../jest/test-helpers';
|
import ChatWidget from './chat-widget/chat-widget';
|
||||||
import ChatWidget from '../chat-widget/chat-widget';
|
|
||||||
|
|
||||||
const id = '1';
|
const id = '1';
|
||||||
const account = buildAccount({
|
const account = buildAccount({
|
|
@ -1,32 +0,0 @@
|
||||||
test.skip('skip', () => {});
|
|
||||||
|
|
||||||
// import userEvent from '@testing-library/user-event';
|
|
||||||
// import React from 'react';
|
|
||||||
|
|
||||||
// import { __stub } from 'soapbox/api';
|
|
||||||
|
|
||||||
// import { render, screen, waitFor } from '../../../../jest/test-helpers';
|
|
||||||
// import Search from '../search';
|
|
||||||
|
|
||||||
// describe('<Search />', () => {
|
|
||||||
// it('successfully renders', async() => {
|
|
||||||
// render(<Search autosuggest />);
|
|
||||||
// expect(screen.getByLabelText('Search')).toBeInTheDocument();
|
|
||||||
// });
|
|
||||||
|
|
||||||
// it('handles onChange', async() => {
|
|
||||||
// __stub(mock => {
|
|
||||||
// mock.onGet('/api/v1/accounts/search').reply(200, [{ id: 1 }]);
|
|
||||||
// });
|
|
||||||
// const user = userEvent.setup();
|
|
||||||
|
|
||||||
// render(<Search autosuggest />);
|
|
||||||
|
|
||||||
// await user.type(screen.getByLabelText('Search'), '@jus');
|
|
||||||
|
|
||||||
// await waitFor(() => {
|
|
||||||
// expect(screen.getByLabelText('Search')).toHaveValue('@jus');
|
|
||||||
// expect(screen.getByTestId('account')).toBeInTheDocument();
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
|
@ -1,8 +1,9 @@
|
||||||
import userEvent from '@testing-library/user-event';
|
import userEvent from '@testing-library/user-event';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { render, screen } from '../../../../../jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import DurationSelector from '../duration-selector';
|
|
||||||
|
import DurationSelector from './duration-selector';
|
||||||
|
|
||||||
describe('<DurationSelector />', () => {
|
describe('<DurationSelector />', () => {
|
||||||
it('defaults to 2 days', () => {
|
it('defaults to 2 days', () => {
|
|
@ -1,4 +1,4 @@
|
||||||
import emojify from '../index';
|
import emojify from '.';
|
||||||
|
|
||||||
describe('emoji', () => {
|
describe('emoji', () => {
|
||||||
describe('.emojify', () => {
|
describe('.emojify', () => {
|
|
@ -1,7 +1,7 @@
|
||||||
import { List, Map } from 'immutable';
|
import { List, Map } from 'immutable';
|
||||||
import pick from 'lodash/pick';
|
import pick from 'lodash/pick';
|
||||||
|
|
||||||
import search, { addCustomToPool } from '../search';
|
import search, { addCustomToPool } from './search';
|
||||||
|
|
||||||
const trimEmojis = (emoji: any) => pick(emoji, ['id', 'unified', 'native', 'custom']);
|
const trimEmojis = (emoji: any) => pick(emoji, ['id', 'unified', 'native', 'custom']);
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import { GroupRoles } from 'soapbox/schemas/group-member';
|
import { GroupRoles } from 'soapbox/schemas/group-member';
|
||||||
import { Group } from 'soapbox/types/entities';
|
import { Group } from 'soapbox/types/entities';
|
||||||
|
|
||||||
import GroupActionButton from '../group-action-button';
|
import GroupActionButton from './group-action-button';
|
||||||
|
|
||||||
let group: Group;
|
let group: Group;
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { buildGroup } from 'soapbox/jest/factory';
|
||||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import { Group } from 'soapbox/types/entities';
|
import { Group } from 'soapbox/types/entities';
|
||||||
|
|
||||||
import GroupHeader from '../group-header';
|
import GroupHeader from './group-header';
|
||||||
|
|
||||||
let group: Group;
|
let group: Group;
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { buildGroup } from 'soapbox/jest/factory';
|
||||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import { Group } from 'soapbox/types/entities';
|
import { Group } from 'soapbox/types/entities';
|
||||||
|
|
||||||
import GroupMemberCount from '../group-member-count';
|
import GroupMemberCount from './group-member-count';
|
||||||
|
|
||||||
let group: Group;
|
let group: Group;
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { buildGroup, buildGroupMember, buildGroupRelationship } from 'soapbox/je
|
||||||
import { render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
import { render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
||||||
import { GroupRoles } from 'soapbox/schemas/group-member';
|
import { GroupRoles } from 'soapbox/schemas/group-member';
|
||||||
|
|
||||||
import GroupMemberListItem from '../group-member-list-item';
|
import GroupMemberListItem from './group-member-list-item';
|
||||||
|
|
||||||
describe('<GroupMemberListItem />', () => {
|
describe('<GroupMemberListItem />', () => {
|
||||||
describe('account rendering', () => {
|
describe('account rendering', () => {
|
|
@ -5,7 +5,7 @@ import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import { GroupRoles } from 'soapbox/schemas/group-member';
|
import { GroupRoles } from 'soapbox/schemas/group-member';
|
||||||
import { Group } from 'soapbox/types/entities';
|
import { Group } from 'soapbox/types/entities';
|
||||||
|
|
||||||
import GroupOptionsButton from '../group-options-button';
|
import GroupOptionsButton from './group-options-button';
|
||||||
|
|
||||||
let group: Group;
|
let group: Group;
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { buildGroup } from 'soapbox/jest/factory';
|
||||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import { Group } from 'soapbox/types/entities';
|
import { Group } from 'soapbox/types/entities';
|
||||||
|
|
||||||
import GroupPrivacy from '../group-privacy';
|
import GroupPrivacy from './group-privacy';
|
||||||
|
|
||||||
let group: Group;
|
let group: Group;
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import { GroupRoles } from 'soapbox/schemas/group-member';
|
import { GroupRoles } from 'soapbox/schemas/group-member';
|
||||||
import { Group } from 'soapbox/types/entities';
|
import { Group } from 'soapbox/types/entities';
|
||||||
|
|
||||||
import GroupRelationship from '../group-relationship';
|
import GroupRelationship from './group-relationship';
|
||||||
|
|
||||||
let group: Group;
|
let group: Group;
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { buildGroup, buildGroupTag, buildGroupRelationship } from 'soapbox/jest/
|
||||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
import { GroupRoles } from 'soapbox/schemas/group-member';
|
import { GroupRoles } from 'soapbox/schemas/group-member';
|
||||||
|
|
||||||
import GroupTagListItem from '../group-tag-list-item';
|
import GroupTagListItem from './group-tag-list-item';
|
||||||
|
|
||||||
describe('<GroupTagListItem />', () => {
|
describe('<GroupTagListItem />', () => {
|
||||||
describe('tag name', () => {
|
describe('tag name', () => {
|
|
@ -1,87 +0,0 @@
|
||||||
test.skip('skip', () => {});
|
|
||||||
|
|
||||||
// import React from 'react';
|
|
||||||
// import { VirtuosoMockContext } from 'react-virtuoso';
|
|
||||||
|
|
||||||
// import { __stub } from 'soapbox/api';
|
|
||||||
// import { buildAccount } from 'soapbox/jest/factory';
|
|
||||||
// import { render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
|
||||||
// import { normalizeGroup, normalizeGroupRelationship, normalizeInstance } from 'soapbox/normalizers';
|
|
||||||
|
|
||||||
// import PendingRequests from '../pending-requests';
|
|
||||||
|
|
||||||
// const userId = '1';
|
|
||||||
// const store: any = {
|
|
||||||
// me: userId,
|
|
||||||
// accounts: {
|
|
||||||
// [userId]: buildAccount({
|
|
||||||
// id: userId,
|
|
||||||
// acct: 'justin-username',
|
|
||||||
// display_name: 'Justin L',
|
|
||||||
// avatar: 'test.jpg',
|
|
||||||
// source: {
|
|
||||||
// chats_onboarded: false,
|
|
||||||
// },
|
|
||||||
// }),
|
|
||||||
// },
|
|
||||||
// instance: normalizeInstance({
|
|
||||||
// version: '3.4.1 (compatible; TruthSocial 1.0.0)',
|
|
||||||
// }),
|
|
||||||
// };
|
|
||||||
|
|
||||||
// const renderApp = () => (
|
|
||||||
// render(
|
|
||||||
// <VirtuosoMockContext.Provider value={{ viewportHeight: 300, itemHeight: 100 }}>
|
|
||||||
// <PendingRequests />
|
|
||||||
// </VirtuosoMockContext.Provider>,
|
|
||||||
// undefined,
|
|
||||||
// store,
|
|
||||||
// )
|
|
||||||
// );
|
|
||||||
|
|
||||||
// describe('<PendingRequests />', () => {
|
|
||||||
// describe('without pending group requests', () => {
|
|
||||||
// beforeEach(() => {
|
|
||||||
// __stub((mock) => {
|
|
||||||
// mock.onGet('/api/v1/groups?pending=true').reply(200, []);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
// it('should render the blankslate', async () => {
|
|
||||||
// renderApp();
|
|
||||||
|
|
||||||
// await waitFor(() => {
|
|
||||||
// expect(screen.getByTestId('pending-requests-blankslate')).toBeInTheDocument();
|
|
||||||
// expect(screen.queryAllByTestId('group-card')).toHaveLength(0);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
// describe('with pending group requests', () => {
|
|
||||||
// beforeEach(() => {
|
|
||||||
// __stub((mock) => {
|
|
||||||
// mock.onGet('/api/v1/groups').reply(200, [
|
|
||||||
// normalizeGroup({
|
|
||||||
// display_name: 'Group',
|
|
||||||
// id: '1',
|
|
||||||
// }),
|
|
||||||
// ]);
|
|
||||||
|
|
||||||
// mock.onGet('/api/v1/groups/relationships?id[]=1').reply(200, [
|
|
||||||
// normalizeGroupRelationship({
|
|
||||||
// id: '1',
|
|
||||||
// }),
|
|
||||||
// ]);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
// it('should render the groups', async () => {
|
|
||||||
// renderApp();
|
|
||||||
|
|
||||||
// await waitFor(() => {
|
|
||||||
// expect(screen.queryAllByTestId('group-card')).toHaveLength(1);
|
|
||||||
// expect(screen.queryAllByTestId('pending-requests-blankslate')).toHaveLength(0);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
|
@ -1,107 +0,0 @@
|
||||||
test.skip('skip', () => {});
|
|
||||||
|
|
||||||
// import React from 'react';
|
|
||||||
// import { VirtuosoMockContext } from 'react-virtuoso';
|
|
||||||
|
|
||||||
// import { __stub } from 'soapbox/api';
|
|
||||||
// import { buildAccount } from 'soapbox/jest/factory';
|
|
||||||
// import { render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
|
||||||
// import { normalizeGroup, normalizeGroupRelationship, normalizeInstance } from 'soapbox/normalizers';
|
|
||||||
|
|
||||||
// import PendingGroupsRow from '../pending-groups-row';
|
|
||||||
|
|
||||||
// const userId = '1';
|
|
||||||
// let store: any = {
|
|
||||||
// me: userId,
|
|
||||||
// accounts: {
|
|
||||||
// [userId]: buildAccount({
|
|
||||||
// id: userId,
|
|
||||||
// acct: 'justin-username',
|
|
||||||
// display_name: 'Justin L',
|
|
||||||
// avatar: 'test.jpg',
|
|
||||||
// source: {
|
|
||||||
// chats_onboarded: false,
|
|
||||||
// },
|
|
||||||
// }),
|
|
||||||
// },
|
|
||||||
// };
|
|
||||||
|
|
||||||
// const renderApp = (store: any) => (
|
|
||||||
// render(
|
|
||||||
// <VirtuosoMockContext.Provider value={{ viewportHeight: 300, itemHeight: 100 }}>
|
|
||||||
// <PendingGroupsRow />
|
|
||||||
// </VirtuosoMockContext.Provider>,
|
|
||||||
// undefined,
|
|
||||||
// store,
|
|
||||||
// )
|
|
||||||
// );
|
|
||||||
|
|
||||||
// describe('<PendingGroupRows />', () => {
|
|
||||||
// describe('without the feature', () => {
|
|
||||||
// beforeEach(() => {
|
|
||||||
// store = {
|
|
||||||
// ...store,
|
|
||||||
// instance: normalizeInstance({
|
|
||||||
// version: '2.7.2 (compatible; Pleroma 2.3.0)',
|
|
||||||
// }),
|
|
||||||
// };
|
|
||||||
// });
|
|
||||||
|
|
||||||
// it('should not render', () => {
|
|
||||||
// renderApp(store);
|
|
||||||
// expect(screen.queryAllByTestId('pending-items-row')).toHaveLength(0);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
// describe('with the feature', () => {
|
|
||||||
// beforeEach(() => {
|
|
||||||
// store = {
|
|
||||||
// ...store,
|
|
||||||
// instance: normalizeInstance({
|
|
||||||
// version: '3.4.1 (compatible; TruthSocial 1.0.0)',
|
|
||||||
// software: 'TRUTHSOCIAL',
|
|
||||||
// }),
|
|
||||||
// };
|
|
||||||
// });
|
|
||||||
|
|
||||||
// describe('without pending group requests', () => {
|
|
||||||
// beforeEach(() => {
|
|
||||||
// __stub((mock) => {
|
|
||||||
// mock.onGet('/api/v1/groups?pending=true').reply(200, []);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
// it('should not render', () => {
|
|
||||||
// renderApp(store);
|
|
||||||
// expect(screen.queryAllByTestId('pending-items-row')).toHaveLength(0);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
// describe('with pending group requests', () => {
|
|
||||||
// beforeEach(() => {
|
|
||||||
// __stub((mock) => {
|
|
||||||
// mock.onGet('/api/v1/groups').reply(200, [
|
|
||||||
// normalizeGroup({
|
|
||||||
// display_name: 'Group',
|
|
||||||
// id: '1',
|
|
||||||
// }),
|
|
||||||
// ]);
|
|
||||||
|
|
||||||
// mock.onGet('/api/v1/groups/relationships?id[]=1').reply(200, [
|
|
||||||
// normalizeGroupRelationship({
|
|
||||||
// id: '1',
|
|
||||||
// }),
|
|
||||||
// ]);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
// it('should render the row', async () => {
|
|
||||||
// renderApp(store);
|
|
||||||
|
|
||||||
// await waitFor(() => {
|
|
||||||
// expect(screen.queryAllByTestId('pending-items-row')).toHaveLength(1);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||||
import { buildGroup } from 'soapbox/jest/factory';
|
import { buildGroup } from 'soapbox/jest/factory';
|
||||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import GroupGridItem from '../group-grid-item';
|
import GroupGridItem from './group-grid-item';
|
||||||
|
|
||||||
describe('<GroupGridItem', () => {
|
describe('<GroupGridItem', () => {
|
||||||
it('should render correctly', () => {
|
it('should render correctly', () => {
|
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||||
import { buildGroup } from 'soapbox/jest/factory';
|
import { buildGroup } from 'soapbox/jest/factory';
|
||||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import GroupListItem from '../group-list-item';
|
import GroupListItem from './group-list-item';
|
||||||
|
|
||||||
describe('<GroupListItem', () => {
|
describe('<GroupListItem', () => {
|
||||||
it('should render correctly', () => {
|
it('should render correctly', () => {
|
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||||
|
|
||||||
import { render, screen, within } from 'soapbox/jest/test-helpers';
|
import { render, screen, within } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import LayoutButtons, { GroupLayout } from '../layout-buttons';
|
import LayoutButtons, { GroupLayout } from './layout-buttons';
|
||||||
|
|
||||||
describe('<LayoutButtons', () => {
|
describe('<LayoutButtons', () => {
|
||||||
describe('when LIST view', () => {
|
describe('when LIST view', () => {
|
|
@ -1,82 +0,0 @@
|
||||||
test.skip('skip', () => {});
|
|
||||||
|
|
||||||
// import userEvent from '@testing-library/user-event';
|
|
||||||
// import React from 'react';
|
|
||||||
// import { VirtuosoMockContext } from 'react-virtuoso';
|
|
||||||
|
|
||||||
// import { buildAccount } from 'soapbox/jest/factory';
|
|
||||||
// import { render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
|
||||||
// import { groupSearchHistory } from 'soapbox/settings';
|
|
||||||
// import { clearRecentGroupSearches, saveGroupSearch } from 'soapbox/utils/groups';
|
|
||||||
|
|
||||||
// import RecentSearches from '../recent-searches';
|
|
||||||
|
|
||||||
// const userId = '1';
|
|
||||||
// const store = {
|
|
||||||
// me: userId,
|
|
||||||
// accounts: {
|
|
||||||
// [userId]: buildAccount({
|
|
||||||
// id: userId,
|
|
||||||
// acct: 'justin-username',
|
|
||||||
// display_name: 'Justin L',
|
|
||||||
// avatar: 'test.jpg',
|
|
||||||
// source: {
|
|
||||||
// chats_onboarded: false,
|
|
||||||
// },
|
|
||||||
// }),
|
|
||||||
// },
|
|
||||||
// };
|
|
||||||
|
|
||||||
// const renderApp = (children: React.ReactNode) => (
|
|
||||||
// render(
|
|
||||||
// <VirtuosoMockContext.Provider value={{ viewportHeight: 300, itemHeight: 100 }}>
|
|
||||||
// {children}
|
|
||||||
// </VirtuosoMockContext.Provider>,
|
|
||||||
// undefined,
|
|
||||||
// store,
|
|
||||||
// )
|
|
||||||
// );
|
|
||||||
|
|
||||||
// describe('<RecentSearches />', () => {
|
|
||||||
// describe('with recent searches', () => {
|
|
||||||
// beforeEach(() => {
|
|
||||||
// saveGroupSearch(userId, 'foobar');
|
|
||||||
// });
|
|
||||||
|
|
||||||
// afterEach(() => {
|
|
||||||
// clearRecentGroupSearches(userId);
|
|
||||||
// });
|
|
||||||
|
|
||||||
// it('should render the recent searches', async () => {
|
|
||||||
// renderApp(<RecentSearches onSelect={vi.fn()} />);
|
|
||||||
|
|
||||||
// await waitFor(() => {
|
|
||||||
// expect(screen.getByTestId('recent-search')).toBeInTheDocument();
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
// it('should support clearing recent searches', async () => {
|
|
||||||
// renderApp(<RecentSearches onSelect={vi.fn()} />);
|
|
||||||
|
|
||||||
// expect(groupSearchHistory.get(userId)).toHaveLength(1);
|
|
||||||
// await userEvent.click(screen.getByTestId('clear-recent-searches'));
|
|
||||||
// expect(groupSearchHistory.get(userId)).toBeNull();
|
|
||||||
// });
|
|
||||||
|
|
||||||
// it('should support click events on the results', async () => {
|
|
||||||
// const handler = vi.fn();
|
|
||||||
// renderApp(<RecentSearches onSelect={handler} />);
|
|
||||||
// expect(handler.mock.calls.length).toEqual(0);
|
|
||||||
// await userEvent.click(screen.getByTestId('recent-search-result'));
|
|
||||||
// expect(handler.mock.calls.length).toEqual(1);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
// describe('without recent searches', () => {
|
|
||||||
// it('should render the blankslate', async () => {
|
|
||||||
// renderApp(<RecentSearches onSelect={vi.fn()} />);
|
|
||||||
|
|
||||||
// expect(screen.getByTestId('recent-searches-blankslate')).toBeInTheDocument();
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||||
|
|
||||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import Blankslate from '../blankslate';
|
import Blankslate from './blankslate';
|
||||||
|
|
||||||
|
|
||||||
describe('<Blankslate />', () => {
|
describe('<Blankslate />', () => {
|
|
@ -5,7 +5,7 @@ import { VirtuosoGridMockContext, VirtuosoMockContext } from 'react-virtuoso';
|
||||||
import { buildAccount, buildGroup } from 'soapbox/jest/factory';
|
import { buildAccount, buildGroup } from 'soapbox/jest/factory';
|
||||||
import { render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
import { render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import Results from '../results';
|
import Results from './results';
|
||||||
|
|
||||||
const userId = '1';
|
const userId = '1';
|
||||||
const store = {
|
const store = {
|
|
@ -5,7 +5,7 @@ import { buildGroup } from 'soapbox/jest/factory';
|
||||||
import { render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
import { render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
||||||
import { normalizeInstance } from 'soapbox/normalizers';
|
import { normalizeInstance } from 'soapbox/normalizers';
|
||||||
|
|
||||||
import Search from '../search';
|
import Search from './search';
|
||||||
|
|
||||||
const store = {
|
const store = {
|
||||||
instance: normalizeInstance({
|
instance: normalizeInstance({
|
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||||
import { buildGroupTag } from 'soapbox/jest/factory';
|
import { buildGroupTag } from 'soapbox/jest/factory';
|
||||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import TagListItem from '../tag-list-item';
|
import TagListItem from './tag-list-item';
|
||||||
|
|
||||||
describe('<TagListItem', () => {
|
describe('<TagListItem', () => {
|
||||||
it('should render correctly', () => {
|
it('should render correctly', () => {
|
|
@ -5,7 +5,7 @@ import { buildAccount } from 'soapbox/jest/factory';
|
||||||
import { render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
import { render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
||||||
import { normalizeInstance } from 'soapbox/normalizers';
|
import { normalizeInstance } from 'soapbox/normalizers';
|
||||||
|
|
||||||
import Discover from '../discover';
|
import Discover from './discover';
|
||||||
|
|
||||||
vi.mock('../../../hooks/useDimensions', () => ({
|
vi.mock('../../../hooks/useDimensions', () => ({
|
||||||
useDimensions: () => [{ scrollWidth: 190 }, null, { width: 300 }],
|
useDimensions: () => [{ scrollWidth: 190 }, null, { width: 300 }],
|
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||||
import { updateNotifications } from 'soapbox/actions/notifications';
|
import { updateNotifications } from 'soapbox/actions/notifications';
|
||||||
import { render, screen, rootState, createTestStore } from 'soapbox/jest/test-helpers';
|
import { render, screen, rootState, createTestStore } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import Notification from '../notification';
|
import Notification from './notification';
|
||||||
|
|
||||||
/** Prepare the notification for use by the component */
|
/** Prepare the notification for use by the component */
|
||||||
const normalize = (notification: any) => {
|
const normalize = (notification: any) => {
|
|
@ -7,7 +7,7 @@ import { MemoryRouter } from 'react-router-dom';
|
||||||
import { MODAL_CLOSE, MODAL_OPEN } from 'soapbox/actions/modals';
|
import { MODAL_CLOSE, MODAL_OPEN } from 'soapbox/actions/modals';
|
||||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import ComposeButton from '../compose-button';
|
import ComposeButton from './compose-button';
|
||||||
|
|
||||||
const store = mockStore(rootState);
|
const store = mockStore(rootState);
|
||||||
const renderComposeButton = () => {
|
const renderComposeButton = () => {
|
|
@ -1,9 +1,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { storeClosed, storeLoggedIn, storeOpen } from 'soapbox/jest/mock-stores';
|
import { storeClosed, storeLoggedIn, storeOpen } from 'soapbox/jest/mock-stores';
|
||||||
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import { render, screen } from '../../../../jest/test-helpers';
|
import CtaBanner from './cta-banner';
|
||||||
import CtaBanner from '../cta-banner';
|
|
||||||
|
|
||||||
describe('<CtaBanner />', () => {
|
describe('<CtaBanner />', () => {
|
||||||
it('renders the banner', () => {
|
it('renders the banner', () => {
|
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||||
import { storeOpen } from 'soapbox/jest/mock-stores';
|
import { storeOpen } from 'soapbox/jest/mock-stores';
|
||||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import LandingPageModal from '../landing-page-modal';
|
import LandingPageModal from './landing-page-modal';
|
||||||
|
|
||||||
describe('<LandingPageModal />', () => {
|
describe('<LandingPageModal />', () => {
|
||||||
it('successfully renders', () => {
|
it('successfully renders', () => {
|
|
@ -1,77 +0,0 @@
|
||||||
test.skip('skip', () => {});
|
|
||||||
|
|
||||||
// import userEvent from '@testing-library/user-event';
|
|
||||||
// import { Map as ImmutableMap, Record as ImmutableRecord, Set as ImmutableSet } from 'immutable';
|
|
||||||
// import React from 'react';
|
|
||||||
|
|
||||||
// import { ReportableEntities } from 'soapbox/actions/reports';
|
|
||||||
// import { __stub } from 'soapbox/api';
|
|
||||||
// import { buildAccount } from 'soapbox/jest/factory';
|
|
||||||
// import { render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
|
||||||
// import { normalizeStatus } from 'soapbox/normalizers';
|
|
||||||
|
|
||||||
// import ReportModal from '../report-modal';
|
|
||||||
|
|
||||||
// describe('<ReportModal />', () => {
|
|
||||||
// let store: any;
|
|
||||||
|
|
||||||
// beforeEach(() => {
|
|
||||||
// const rules = require('soapbox/__fixtures__/rules.json');
|
|
||||||
// const status = require('soapbox/__fixtures__/status-unordered-mentions.json');
|
|
||||||
|
|
||||||
// store = {
|
|
||||||
// accounts: {
|
|
||||||
// '1': buildAccount({
|
|
||||||
// id: '1',
|
|
||||||
// acct: 'username',
|
|
||||||
// display_name: 'My name',
|
|
||||||
// avatar: 'test.jpg',
|
|
||||||
// }),
|
|
||||||
// },
|
|
||||||
// reports: ImmutableRecord({
|
|
||||||
// new: ImmutableRecord({
|
|
||||||
// account_id: '1',
|
|
||||||
// status_ids: ImmutableSet(['1']),
|
|
||||||
// rule_ids: ImmutableSet(),
|
|
||||||
// entityType: ReportableEntities.STATUS,
|
|
||||||
// })(),
|
|
||||||
// })(),
|
|
||||||
// statuses: ImmutableMap({
|
|
||||||
// '1': normalizeStatus(status),
|
|
||||||
// }),
|
|
||||||
// rules: {
|
|
||||||
// items: rules,
|
|
||||||
// },
|
|
||||||
// };
|
|
||||||
|
|
||||||
// __stub(mock => {
|
|
||||||
// mock.onGet('/api/v1/instance/rules').reply(200, rules);
|
|
||||||
// mock.onPost('/api/v1/reports').reply(200, {});
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
// it('successfully renders the first step', () => {
|
|
||||||
// render(<ReportModal onClose={vi.fn} />, {}, store);
|
|
||||||
// expect(screen.getByText('Reason for reporting')).toBeInTheDocument();
|
|
||||||
// });
|
|
||||||
|
|
||||||
// it('successfully moves to the second step', async() => {
|
|
||||||
// const user = userEvent.setup();
|
|
||||||
// render(<ReportModal onClose={vi.fn} />, {}, store);
|
|
||||||
// await user.click(screen.getByTestId('rule-1'));
|
|
||||||
// await user.click(screen.getByText('Next'));
|
|
||||||
// expect(screen.getByText(/Further actions:/)).toBeInTheDocument();
|
|
||||||
// });
|
|
||||||
|
|
||||||
// it('successfully moves to the third step', async() => {
|
|
||||||
// const user = userEvent.setup();
|
|
||||||
// render(<ReportModal onClose={vi.fn} />, {}, store);
|
|
||||||
// await user.click(screen.getByTestId('rule-1'));
|
|
||||||
// await user.click(screen.getByText(/Next/));
|
|
||||||
// await user.click(screen.getByText(/Submit/));
|
|
||||||
|
|
||||||
// await waitFor(() => {
|
|
||||||
// expect(screen.getByText(/Thanks for submitting your report/)).toBeInTheDocument();
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||||
import { storeOpen } from 'soapbox/jest/mock-stores';
|
import { storeOpen } from 'soapbox/jest/mock-stores';
|
||||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import UnauthorizedModal from '../unauthorized-modal';
|
import UnauthorizedModal from './unauthorized-modal';
|
||||||
|
|
||||||
describe('<UnauthorizedModal />', () => {
|
describe('<UnauthorizedModal />', () => {
|
||||||
it('successfully renders', () => {
|
it('successfully renders', () => {
|
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||||
import { storeOpen } from 'soapbox/jest/mock-stores';
|
import { storeOpen } from 'soapbox/jest/mock-stores';
|
||||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import Navbar from '../navbar';
|
import Navbar from './navbar';
|
||||||
|
|
||||||
describe('<Navbar />', () => {
|
describe('<Navbar />', () => {
|
||||||
it('successfully renders', () => {
|
it('successfully renders', () => {
|
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||||
import { storeOpen } from 'soapbox/jest/mock-stores';
|
import { storeOpen } from 'soapbox/jest/mock-stores';
|
||||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import SignUpPanel from '../sign-up-panel';
|
import SignUpPanel from './sign-up-panel';
|
||||||
|
|
||||||
describe('<SignUpPanel />', () => {
|
describe('<SignUpPanel />', () => {
|
||||||
it('doesn\'t render by default', () => {
|
it('doesn\'t render by default', () => {
|
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||||
import { buildAccount, buildRelationship } from 'soapbox/jest/factory';
|
import { buildAccount, buildRelationship } from 'soapbox/jest/factory';
|
||||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import SubscribeButton from '../subscription-button';
|
import SubscribeButton from './subscription-button';
|
||||||
|
|
||||||
const justin = {
|
const justin = {
|
||||||
id: '1',
|
id: '1',
|
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||||
import { __stub } from 'soapbox/api';
|
import { __stub } from 'soapbox/api';
|
||||||
import { queryClient, render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
import { queryClient, render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
||||||
|
|
||||||
import TrendsPanel from '../trends-panel';
|
import TrendsPanel from './trends-panel';
|
||||||
|
|
||||||
describe('<TrendsPanel />', () => {
|
describe('<TrendsPanel />', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
|
@ -1,7 +1,7 @@
|
||||||
import { renderHook, act } from '@testing-library/react-hooks';
|
import { renderHook, act } from '@testing-library/react-hooks';
|
||||||
|
|
||||||
import { listener, mockDisconnect } from '../__mocks__/resize-observer';
|
import { listener, mockDisconnect } from './__mocks__/resize-observer';
|
||||||
import { useDimensions } from '../useDimensions';
|
import { useDimensions } from './useDimensions';
|
||||||
|
|
||||||
describe('useDimensions()', () => {
|
describe('useDimensions()', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
|
@ -3,7 +3,7 @@ import { buildAccount, buildGroup, buildGroupRelationship } from 'soapbox/jest/f
|
||||||
import { renderHook, waitFor } from 'soapbox/jest/test-helpers';
|
import { renderHook, waitFor } from 'soapbox/jest/test-helpers';
|
||||||
import { normalizeInstance } from 'soapbox/normalizers';
|
import { normalizeInstance } from 'soapbox/normalizers';
|
||||||
|
|
||||||
import { useGroupsPath } from '../useGroupsPath';
|
import { useGroupsPath } from './useGroupsPath';
|
||||||
|
|
||||||
describe('useGroupsPath()', () => {
|
describe('useGroupsPath()', () => {
|
||||||
test('without the groupsDiscovery feature', () => {
|
test('without the groupsDiscovery feature', () => {
|
|
@ -1,6 +1,6 @@
|
||||||
import { Record as ImmutableRecord, fromJS } from 'immutable';
|
import { Record as ImmutableRecord, fromJS } from 'immutable';
|
||||||
|
|
||||||
import { normalizeAccount } from '../account';
|
import { normalizeAccount } from './account';
|
||||||
|
|
||||||
const AVATAR_MISSING = require('soapbox/assets/images/avatar-missing.png');
|
const AVATAR_MISSING = require('soapbox/assets/images/avatar-missing.png');
|
||||||
const HEADER_MISSING = require('soapbox/assets/images/header-missing.png');
|
const HEADER_MISSING = require('soapbox/assets/images/header-missing.png');
|
|
@ -1,6 +1,6 @@
|
||||||
import { Record as ImmutableRecord } from 'immutable';
|
import { Record as ImmutableRecord } from 'immutable';
|
||||||
|
|
||||||
import { normalizeAttachment } from '../attachment';
|
import { normalizeAttachment } from './attachment';
|
||||||
|
|
||||||
describe('normalizeAttachment()', () => {
|
describe('normalizeAttachment()', () => {
|
||||||
it('adds base fields', () => {
|
it('adds base fields', () => {
|
|
@ -1,7 +1,7 @@
|
||||||
import { Record as ImmutableRecord } from 'immutable';
|
import { Record as ImmutableRecord } from 'immutable';
|
||||||
|
|
||||||
import { normalizeAttachment } from '../attachment';
|
import { normalizeAttachment } from './attachment';
|
||||||
import { normalizeChatMessage } from '../chat-message';
|
import { normalizeChatMessage } from './chat-message';
|
||||||
|
|
||||||
describe('normalizeChatMessage()', () => {
|
describe('normalizeChatMessage()', () => {
|
||||||
it('upgrades attachment to media_attachments', () => {
|
it('upgrades attachment to media_attachments', () => {
|
|
@ -1,6 +1,6 @@
|
||||||
import { Map as ImmutableMap, fromJS } from 'immutable';
|
import { Map as ImmutableMap, fromJS } from 'immutable';
|
||||||
|
|
||||||
import { normalizeInstance } from '../instance';
|
import { normalizeInstance } from './instance';
|
||||||
|
|
||||||
describe('normalizeInstance()', () => {
|
describe('normalizeInstance()', () => {
|
||||||
it('normalizes an empty Map', () => {
|
it('normalizes an empty Map', () => {
|
|
@ -1,6 +1,6 @@
|
||||||
import { Record as ImmutableRecord } from 'immutable';
|
import { Record as ImmutableRecord } from 'immutable';
|
||||||
|
|
||||||
import { normalizeMention } from '../mention';
|
import { normalizeMention } from './mention';
|
||||||
|
|
||||||
describe('normalizeMention()', () => {
|
describe('normalizeMention()', () => {
|
||||||
it('adds base fields', () => {
|
it('adds base fields', () => {
|
|
@ -1,6 +1,6 @@
|
||||||
import { Record as ImmutableRecord } from 'immutable';
|
import { Record as ImmutableRecord } from 'immutable';
|
||||||
|
|
||||||
import { normalizeNotification } from '../notification';
|
import { normalizeNotification } from './notification';
|
||||||
|
|
||||||
describe('normalizeNotification()', () => {
|
describe('normalizeNotification()', () => {
|
||||||
it('normalizes an empty map', () => {
|
it('normalizes an empty map', () => {
|
|
@ -1,6 +1,6 @@
|
||||||
import { Record as ImmutableRecord } from 'immutable';
|
import { Record as ImmutableRecord } from 'immutable';
|
||||||
|
|
||||||
import { normalizeSoapboxConfig } from '../soapbox-config';
|
import { normalizeSoapboxConfig } from './soapbox-config';
|
||||||
|
|
||||||
describe('normalizeSoapboxConfig()', () => {
|
describe('normalizeSoapboxConfig()', () => {
|
||||||
it('adds base fields', () => {
|
it('adds base fields', () => {
|
|
@ -1,6 +1,6 @@
|
||||||
import { Record as ImmutableRecord, fromJS } from 'immutable';
|
import { Record as ImmutableRecord, fromJS } from 'immutable';
|
||||||
|
|
||||||
import { normalizeStatus } from '../status';
|
import { normalizeStatus } from './status';
|
||||||
|
|
||||||
import type { Poll, Card } from 'soapbox/types/entities';
|
import type { Poll, Card } from 'soapbox/types/entities';
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { Store } from 'soapbox/store';
|
||||||
import { ChatMessage } from 'soapbox/types/entities';
|
import { ChatMessage } from 'soapbox/types/entities';
|
||||||
import { flattenPages } from 'soapbox/utils/queries';
|
import { flattenPages } from 'soapbox/utils/queries';
|
||||||
|
|
||||||
import { ChatKeys, IChat, isLastMessage, useChat, useChatActions, useChatMessages, useChats } from '../chats';
|
import { ChatKeys, IChat, isLastMessage, useChat, useChatActions, useChatMessages, useChats } from './chats';
|
||||||
|
|
||||||
const chat: IChat = {
|
const chat: IChat = {
|
||||||
accepted: true,
|
accepted: true,
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue