Untuck tests out of __tests__ directories, colocate with program files
This commit is contained in:
@ -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('<Account />', () => {
|
||||
it('renders account name and username', () => {
|
||||
@ -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('<AutosuggestEmoji />', () => {
|
||||
it('renders native emoji', () => {
|
||||
@ -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('<Badge />', () => {
|
||||
it('renders correctly', () => {
|
||||
@ -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('<DisplayName />', () => {
|
||||
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 { type Poll } from 'soapbox/schemas';
|
||||
|
||||
import PollFooter from '../poll-footer';
|
||||
import PollFooter from './poll-footer';
|
||||
|
||||
let poll: Poll = {
|
||||
id: '1',
|
||||
@ -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';
|
||||
|
||||
@ -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}}' },
|
||||
@ -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';
|
||||
|
||||
@ -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('<SensitiveContentOverlay />', () => {
|
||||
let status: ReducerStatus;
|
||||
@ -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';
|
||||
|
||||
@ -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('<Button />', () => {
|
||||
it('renders the given text', () => {
|
||||
@ -1,7 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import { render, screen } from '../../../../jest/test-helpers';
|
||||
import { Card, CardBody, CardHeader, CardTitle } from '../card';
|
||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import { Card, CardBody, CardHeader, CardTitle } from './card';
|
||||
|
||||
describe('<Card />', () => {
|
||||
it('renders the CardTitle and CardBody', () => {
|
||||
@ -1,7 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import { render, screen } from '../../../../jest/test-helpers';
|
||||
import { Column } from '../column';
|
||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import { Column } from './column';
|
||||
|
||||
describe('<Column />', () => {
|
||||
it('renders correctly with minimal props', () => {
|
||||
@ -1,8 +1,9 @@
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
|
||||
import { queryAllByRole, render, screen } from '../../../../jest/test-helpers';
|
||||
import Datepicker from '../datepicker';
|
||||
import { queryAllByRole, render, screen } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import Datepicker from './datepicker';
|
||||
|
||||
describe('<Datepicker />', () => {
|
||||
it('defaults to the current date', () => {
|
||||
@ -1,7 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import { render, screen } from '../../../../jest/test-helpers';
|
||||
import Divider from '../divider';
|
||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import Divider from './divider';
|
||||
|
||||
describe('<Divider />', () => {
|
||||
it('renders without text', () => {
|
||||
@ -1,7 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import { render, screen } from '../../../../jest/test-helpers';
|
||||
import Emoji from '../emoji';
|
||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import Emoji from './emoji';
|
||||
|
||||
describe('<Emoji />', () => {
|
||||
it('renders a simple emoji', () => {
|
||||
@ -1,7 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import { render, screen } from '../../../../jest/test-helpers';
|
||||
import FormActions from '../form-actions';
|
||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import FormActions from './form-actions';
|
||||
|
||||
describe('<FormActions />', () => {
|
||||
it('renders successfully', () => {
|
||||
@ -1,7 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import { render, screen } from '../../../../jest/test-helpers';
|
||||
import FormGroup from '../form-group';
|
||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import FormGroup from './form-group';
|
||||
|
||||
describe('<FormGroup />', () => {
|
||||
it('connects the label and input', () => {
|
||||
@ -1,7 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import { fireEvent, render, screen } from '../../../../jest/test-helpers';
|
||||
import Form from '../form';
|
||||
import { fireEvent, render, screen } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import Form from './form';
|
||||
|
||||
describe('<Form />', () => {
|
||||
it('renders children', () => {
|
||||
@ -1,7 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import { render, screen } from '../../../../jest/test-helpers';
|
||||
import SvgIcon from '../svg-icon';
|
||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import SvgIcon from './svg-icon';
|
||||
|
||||
describe('<SvgIcon />', () => {
|
||||
it('renders loading element with default size', () => {
|
||||
@ -1,8 +1,9 @@
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
|
||||
import { render, screen } from '../../../../jest/test-helpers';
|
||||
import Modal from '../modal';
|
||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import Modal from './modal';
|
||||
|
||||
describe('<Modal />', () => {
|
||||
it('renders', () => {
|
||||
@ -1,7 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import { render, screen } from '../../jest/test-helpers';
|
||||
import ValidationCheckmark from '../validation-checkmark';
|
||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import ValidationCheckmark from './validation-checkmark';
|
||||
|
||||
describe('<ValidationCheckmark />', () => {
|
||||
it('renders text', () => {
|
||||
Reference in New Issue
Block a user