soapbox/app/soapbox/features/ui/components/modals/report-modal/__tests__/report-modal.test.tsx

78 wiersze
2.6 KiB
TypeScript
Czysty Zwykły widok Historia

2023-06-21 02:44:07 +00:00
test.skip('skip', () => {});
2022-05-02 13:48:37 +00:00
2023-06-21 02:44:07 +00:00
// import userEvent from '@testing-library/user-event';
// import { Map as ImmutableMap, Record as ImmutableRecord, Set as ImmutableSet } from 'immutable';
// import React from 'react';
2022-05-02 13:48:37 +00:00
2023-06-21 02:44:07 +00:00
// 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';
2022-05-02 13:48:37 +00:00
2023-06-21 02:44:07 +00:00
// import ReportModal from '../report-modal';
2022-05-02 13:48:37 +00:00
2023-06-21 02:44:07 +00:00
// describe('<ReportModal />', () => {
// let store: any;
2022-05-02 13:48:37 +00:00
2023-06-21 02:44:07 +00:00
// beforeEach(() => {
// const rules = require('soapbox/__fixtures__/rules.json');
// const status = require('soapbox/__fixtures__/status-unordered-mentions.json');
2022-05-02 13:48:37 +00:00
2023-06-21 02:44:07 +00:00
// 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,
// },
// };
2022-05-02 13:48:37 +00:00
2023-06-21 02:44:07 +00:00
// __stub(mock => {
// mock.onGet('/api/v1/instance/rules').reply(200, rules);
// mock.onPost('/api/v1/reports').reply(200, {});
// });
// });
2022-05-02 13:48:37 +00:00
2023-06-21 02:44:07 +00:00
// it('successfully renders the first step', () => {
2023-09-16 20:16:59 +00:00
// render(<ReportModal onClose={vi.fn} />, {}, store);
2023-06-21 02:44:07 +00:00
// expect(screen.getByText('Reason for reporting')).toBeInTheDocument();
// });
2022-05-02 13:48:37 +00:00
2023-06-21 02:44:07 +00:00
// it('successfully moves to the second step', async() => {
// const user = userEvent.setup();
2023-09-16 20:16:59 +00:00
// render(<ReportModal onClose={vi.fn} />, {}, store);
2023-06-21 02:44:07 +00:00
// await user.click(screen.getByTestId('rule-1'));
// await user.click(screen.getByText('Next'));
// expect(screen.getByText(/Further actions:/)).toBeInTheDocument();
// });
2023-01-05 23:32:04 +00:00
2023-06-21 02:44:07 +00:00
// it('successfully moves to the third step', async() => {
// const user = userEvent.setup();
2023-09-16 20:16:59 +00:00
// render(<ReportModal onClose={vi.fn} />, {}, store);
2023-06-21 02:44:07 +00:00
// 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();
// });
// });
// });