Untuck tests out of __tests__ directories, colocate with program files
This commit is contained in:
@ -2,7 +2,7 @@ import { AccountRecord } from 'soapbox/normalizers';
|
||||
|
||||
import {
|
||||
getDomain,
|
||||
} from '../accounts';
|
||||
} from './accounts';
|
||||
|
||||
import type { ReducerAccount } from 'soapbox/reducers/accounts';
|
||||
|
||||
@ -6,7 +6,7 @@ import {
|
||||
filterBadges,
|
||||
getTagDiff,
|
||||
getBadges,
|
||||
} from '../badges';
|
||||
} from './badges';
|
||||
|
||||
test('tagToBadge', () => {
|
||||
expect(tagToBadge('yolo')).toEqual('badge:yolo');
|
||||
@ -1,4 +1,4 @@
|
||||
import * as base64 from '../base64';
|
||||
import * as base64 from './base64';
|
||||
|
||||
describe('base64', () => {
|
||||
describe('decode', () => {
|
||||
@ -3,7 +3,7 @@ import { normalizeChatMessage } from 'soapbox/normalizers';
|
||||
import { ChatKeys, IChat } from 'soapbox/queries/chats';
|
||||
import { queryClient } from 'soapbox/queries/client';
|
||||
|
||||
import { updateChatMessage } from '../chats';
|
||||
import { updateChatMessage } from './chats';
|
||||
|
||||
const chat: IChat = {
|
||||
accepted: true,
|
||||
@ -1,4 +1,4 @@
|
||||
import tintify from '../colors';
|
||||
import tintify from './colors';
|
||||
|
||||
const AZURE = '#0482d8';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { compareId } from '../comparators';
|
||||
import { compareId } from './comparators';
|
||||
|
||||
test('compareId', () => {
|
||||
expect(compareId('3', '3')).toBe(0);
|
||||
@ -2,7 +2,7 @@ import { List as ImmutableList, fromJS } from 'immutable';
|
||||
|
||||
import config_db from 'soapbox/__fixtures__/config_db.json';
|
||||
|
||||
import { ConfigDB } from '../config-db';
|
||||
import { ConfigDB } from './config-db';
|
||||
|
||||
test('find', () => {
|
||||
const configs = fromJS(config_db).get('configs');
|
||||
@ -10,7 +10,7 @@ import {
|
||||
getReactForStatus,
|
||||
simulateEmojiReact,
|
||||
simulateUnEmojiReact,
|
||||
} from '../emoji-reacts';
|
||||
} from './emoji-reacts';
|
||||
|
||||
const ALLOWED_EMOJI = ImmutableList([
|
||||
'👍',
|
||||
@ -1,7 +1,7 @@
|
||||
import {
|
||||
removeVS16s,
|
||||
toCodePoints,
|
||||
} from '../emoji';
|
||||
} from './emoji';
|
||||
|
||||
const ASCII_HEART = '❤'; // '\u2764\uFE0F'
|
||||
const RED_HEART_RGI = '❤️'; // '\u2764'
|
||||
@ -3,7 +3,7 @@ import { buildInstance } from 'soapbox/jest/factory';
|
||||
import {
|
||||
parseVersion,
|
||||
getFeatures,
|
||||
} from '../features';
|
||||
} from './features';
|
||||
|
||||
describe('parseVersion', () => {
|
||||
it('with Pleroma version string', () => {
|
||||
@ -1,4 +1,4 @@
|
||||
import * as html from '../html';
|
||||
import * as html from './html';
|
||||
|
||||
describe('html', () => {
|
||||
describe('unsecapeHTML', () => {
|
||||
@ -1,4 +1,4 @@
|
||||
import { normalizeUsername } from '../input';
|
||||
import { normalizeUsername } from './input';
|
||||
|
||||
test('normalizeUsername', () => {
|
||||
expect(normalizeUsername('@alex')).toBe('alex');
|
||||
@ -1,4 +1,4 @@
|
||||
import { addAutoPlay } from '../media';
|
||||
import { addAutoPlay } from './media';
|
||||
|
||||
describe('addAutoPlay()', () => {
|
||||
describe('when the provider is Rumble', () => {
|
||||
@ -1,7 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import { render, screen } from '../../jest/test-helpers';
|
||||
import { isIntegerId, secondsToDays, shortNumberFormat } from '../numbers';
|
||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import { isIntegerId, secondsToDays, shortNumberFormat } from './numbers';
|
||||
|
||||
test('isIntegerId()', () => {
|
||||
expect(isIntegerId('0')).toBe(true);
|
||||
@ -2,7 +2,7 @@ import { InfiniteData } from '@tanstack/react-query';
|
||||
|
||||
import { queryClient } from 'soapbox/queries/client';
|
||||
|
||||
import { PaginatedResult, sortQueryData, updatePageItem } from '../queries';
|
||||
import { PaginatedResult, sortQueryData, updatePageItem } from './queries';
|
||||
|
||||
interface Item {
|
||||
id: number;
|
||||
@ -4,7 +4,7 @@ import { buildStatus } from 'soapbox/jest/factory';
|
||||
import {
|
||||
hasIntegerMediaIds,
|
||||
defaultMediaVisibility,
|
||||
} from '../status';
|
||||
} from './status';
|
||||
|
||||
describe('hasIntegerMediaIds()', () => {
|
||||
it('returns true for a Pleroma deleted status', () => {
|
||||
@ -1,6 +1,6 @@
|
||||
import { Map as ImmutableMap } from 'immutable';
|
||||
|
||||
import { toTailwind, fromLegacyColors, expandPalette } from '../tailwind';
|
||||
import { toTailwind, fromLegacyColors, expandPalette } from './tailwind';
|
||||
|
||||
describe('toTailwind()', () => {
|
||||
it('handles empty Soapbox config', () => {
|
||||
@ -2,7 +2,7 @@ import { fromJS } from 'immutable';
|
||||
|
||||
import { buildStatus } from 'soapbox/jest/factory';
|
||||
|
||||
import { shouldFilter } from '../timelines';
|
||||
import { shouldFilter } from './timelines';
|
||||
|
||||
describe('shouldFilter', () => {
|
||||
it('returns false under normal circumstances', () => {
|
||||
Reference in New Issue
Block a user