Untuck tests out of __tests__ directories, colocate with program files
This commit is contained in:
@ -7,7 +7,7 @@ import { MemoryRouter } from 'react-router-dom';
|
||||
import { MODAL_CLOSE, MODAL_OPEN } from 'soapbox/actions/modals';
|
||||
import { mockStore, rootState } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import ComposeButton from '../compose-button';
|
||||
import ComposeButton from './compose-button';
|
||||
|
||||
const store = mockStore(rootState);
|
||||
const renderComposeButton = () => {
|
||||
@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
|
||||
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 />', () => {
|
||||
it('renders the banner', () => {
|
||||
@ -3,7 +3,7 @@ import React from 'react';
|
||||
import { storeOpen } from 'soapbox/jest/mock-stores';
|
||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import LandingPageModal from '../landing-page-modal';
|
||||
import LandingPageModal from './landing-page-modal';
|
||||
|
||||
describe('<LandingPageModal />', () => {
|
||||
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 { render, screen } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import UnauthorizedModal from '../unauthorized-modal';
|
||||
import UnauthorizedModal from './unauthorized-modal';
|
||||
|
||||
describe('<UnauthorizedModal />', () => {
|
||||
it('successfully renders', () => {
|
||||
@ -3,7 +3,7 @@ import React from 'react';
|
||||
import { storeOpen } from 'soapbox/jest/mock-stores';
|
||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import Navbar from '../navbar';
|
||||
import Navbar from './navbar';
|
||||
|
||||
describe('<Navbar />', () => {
|
||||
it('successfully renders', () => {
|
||||
@ -3,7 +3,7 @@ import React from 'react';
|
||||
import { storeOpen } from 'soapbox/jest/mock-stores';
|
||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import SignUpPanel from '../sign-up-panel';
|
||||
import SignUpPanel from './sign-up-panel';
|
||||
|
||||
describe('<SignUpPanel />', () => {
|
||||
it('doesn\'t render by default', () => {
|
||||
@ -3,7 +3,7 @@ import React from 'react';
|
||||
import { buildAccount, buildRelationship } from 'soapbox/jest/factory';
|
||||
import { render, screen } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import SubscribeButton from '../subscription-button';
|
||||
import SubscribeButton from './subscription-button';
|
||||
|
||||
const justin = {
|
||||
id: '1',
|
||||
@ -3,7 +3,7 @@ import React from 'react';
|
||||
import { __stub } from 'soapbox/api';
|
||||
import { queryClient, render, screen, waitFor } from 'soapbox/jest/test-helpers';
|
||||
|
||||
import TrendsPanel from '../trends-panel';
|
||||
import TrendsPanel from './trends-panel';
|
||||
|
||||
describe('<TrendsPanel />', () => {
|
||||
beforeEach(() => {
|
||||
Reference in New Issue
Block a user