Update tests, remove unused code

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
merge-requests/1271/head
marcin mikołajczak 2022-04-29 23:19:52 +02:00
rodzic d487e34548
commit db56d9b16a
2 zmienionych plików z 4 dodań i 23 usunięć

Wyświetl plik

@ -1,5 +1,5 @@
import { isLoggedIn } from 'soapbox/utils/auth';
import { getFeatures, parseVersion } from 'soapbox/utils/features';
import { getFeatures } from 'soapbox/utils/features';
import { shouldHaveCard } from 'soapbox/utils/status';
import api, { getNextLink } from '../api';
@ -40,8 +40,6 @@ export const STATUS_UNMUTE_FAIL = 'STATUS_UNMUTE_FAIL';
export const STATUS_REVEAL = 'STATUS_REVEAL';
export const STATUS_HIDE = 'STATUS_HIDE';
export const REDRAFT = 'REDRAFT';
const statusExists = (getState, statusId) => {
return getState().getIn(['statuses', statusId], null) !== null;
};
@ -124,22 +122,6 @@ export function fetchStatus(id) {
};
}
export function redraft(status, raw_text, content_type) {
return (dispatch, getState) => {
const { instance } = getState();
const { explicitAddressing } = getFeatures(instance);
dispatch({
type: REDRAFT,
status,
raw_text,
explicitAddressing,
content_type,
v: parseVersion(instance.version),
});
};
}
export function deleteStatus(id, routerHistory, withRedraft = false) {
return (dispatch, getState) => {
if (!isLoggedIn(getState)) return;

Wyświetl plik

@ -3,7 +3,6 @@ import { Map as ImmutableMap, fromJS } from 'immutable';
import * as actions from 'soapbox/actions/compose';
import { ME_FETCH_SUCCESS, ME_PATCH_SUCCESS } from 'soapbox/actions/me';
import { SETTING_CHANGE } from 'soapbox/actions/settings';
import { REDRAFT } from 'soapbox/actions/statuses';
import { TIMELINE_DELETE } from 'soapbox/actions/timelines';
import { normalizeStatus } from 'soapbox/normalizers/status';
@ -39,10 +38,10 @@ describe('compose reducer', () => {
expect(state.get('idempotencyKey').length === 36);
});
describe('REDRAFT', () => {
describe('COMPOSE_SET_STATUS', () => {
it('strips Pleroma integer attachments', () => {
const action = {
type: REDRAFT,
type: actions.COMPOSE_SET_STATUS,
status: normalizeStatus(fromJS(require('soapbox/__fixtures__/pleroma-status-deleted.json'))),
v: { software: 'Pleroma' },
};
@ -53,7 +52,7 @@ describe('compose reducer', () => {
it('leaves non-Pleroma integer attachments alone', () => {
const action = {
type: REDRAFT,
type: actions.COMPOSE_SET_STATUS,
status: normalizeStatus(fromJS(require('soapbox/__fixtures__/pleroma-status-deleted.json'))),
};