2020-06-09 18:08:07 -07:00
|
|
|
import reducer from '../compose';
|
2020-06-16 14:58:09 -07:00
|
|
|
import { Map as ImmutableMap } from 'immutable';
|
2020-06-30 17:18:26 -07:00
|
|
|
//import { COMPOSE_REPLY } from 'soapbox/actions/compose';
|
2020-06-16 15:55:41 -07:00
|
|
|
import { ME_FETCH_SUCCESS, ME_PATCH_SUCCESS } from 'soapbox/actions/me';
|
2020-06-16 14:58:09 -07:00
|
|
|
import { SETTING_CHANGE } from 'soapbox/actions/settings';
|
2020-06-30 17:18:26 -07:00
|
|
|
import * as actions from 'soapbox/actions/compose';
|
|
|
|
import { STORE_HYDRATE } from 'soapbox/actions/store';
|
|
|
|
import { REDRAFT } from 'soapbox/actions/statuses';
|
|
|
|
import { TIMELINE_DELETE } from 'soapbox/actions/timelines';
|
2020-07-01 14:40:15 -07:00
|
|
|
import uuid from 'soapbox/uuid';
|
2020-06-09 18:08:07 -07:00
|
|
|
|
|
|
|
describe('compose reducer', () => {
|
2020-06-16 14:58:09 -07:00
|
|
|
it('returns the initial state by default', () => {
|
2020-06-09 18:08:07 -07:00
|
|
|
expect(reducer(undefined, {}).toJS()).toMatchObject({
|
|
|
|
mounted: 0,
|
|
|
|
sensitive: false,
|
|
|
|
spoiler: false,
|
|
|
|
spoiler_text: '',
|
|
|
|
privacy: null,
|
|
|
|
text: '',
|
|
|
|
focusDate: null,
|
|
|
|
caretPosition: null,
|
|
|
|
in_reply_to: null,
|
|
|
|
is_composing: false,
|
|
|
|
is_submitting: false,
|
|
|
|
is_changing_upload: false,
|
|
|
|
is_uploading: false,
|
|
|
|
progress: 0,
|
|
|
|
media_attachments: [],
|
|
|
|
poll: null,
|
|
|
|
suggestion_token: null,
|
|
|
|
suggestions: [],
|
|
|
|
default_privacy: 'public',
|
|
|
|
default_sensitive: false,
|
|
|
|
idempotencyKey: null,
|
|
|
|
tagHistory: [],
|
|
|
|
});
|
|
|
|
});
|
2020-06-16 14:58:09 -07:00
|
|
|
|
|
|
|
it('uses \'public\' scope as default', () => {
|
|
|
|
const action = {
|
2020-06-30 17:18:26 -07:00
|
|
|
type: actions.COMPOSE_REPLY,
|
2020-06-16 14:58:09 -07:00
|
|
|
status: ImmutableMap(),
|
|
|
|
account: ImmutableMap(),
|
|
|
|
};
|
|
|
|
expect(reducer(undefined, action).toJS()).toMatchObject({ privacy: 'public' });
|
|
|
|
});
|
|
|
|
|
|
|
|
it('uses \'direct\' scope when replying to a DM', () => {
|
|
|
|
const state = ImmutableMap({ default_privacy: 'public' });
|
|
|
|
const action = {
|
2020-06-30 17:18:26 -07:00
|
|
|
type: actions.COMPOSE_REPLY,
|
2020-06-16 14:58:09 -07:00
|
|
|
status: ImmutableMap({ visibility: 'direct' }),
|
|
|
|
account: ImmutableMap(),
|
|
|
|
};
|
|
|
|
expect(reducer(state, action).toJS()).toMatchObject({ privacy: 'direct' });
|
|
|
|
});
|
|
|
|
|
|
|
|
it('uses \'private\' scope when replying to a private post', () => {
|
|
|
|
const state = ImmutableMap({ default_privacy: 'public' });
|
|
|
|
const action = {
|
2020-06-30 17:18:26 -07:00
|
|
|
type: actions.COMPOSE_REPLY,
|
2020-06-16 14:58:09 -07:00
|
|
|
status: ImmutableMap({ visibility: 'private' }),
|
|
|
|
account: ImmutableMap(),
|
|
|
|
};
|
|
|
|
expect(reducer(state, action).toJS()).toMatchObject({ privacy: 'private' });
|
|
|
|
});
|
|
|
|
|
|
|
|
it('uses \'unlisted\' scope when replying to an unlisted post', () => {
|
|
|
|
const state = ImmutableMap({ default_privacy: 'public' });
|
|
|
|
const action = {
|
2020-06-30 17:18:26 -07:00
|
|
|
type: actions.COMPOSE_REPLY,
|
2020-06-16 14:58:09 -07:00
|
|
|
status: ImmutableMap({ visibility: 'unlisted' }),
|
|
|
|
account: ImmutableMap(),
|
|
|
|
};
|
|
|
|
expect(reducer(state, action).toJS()).toMatchObject({ privacy: 'unlisted' });
|
|
|
|
});
|
|
|
|
|
|
|
|
it('uses \'private\' scope when set as preference and replying to a public post', () => {
|
|
|
|
const state = ImmutableMap({ default_privacy: 'private' });
|
|
|
|
const action = {
|
2020-06-30 17:18:26 -07:00
|
|
|
type: actions.COMPOSE_REPLY,
|
2020-06-16 14:58:09 -07:00
|
|
|
status: ImmutableMap({ visibility: 'public' }),
|
|
|
|
account: ImmutableMap(),
|
|
|
|
};
|
|
|
|
expect(reducer(state, action).toJS()).toMatchObject({ privacy: 'private' });
|
|
|
|
});
|
|
|
|
|
|
|
|
it('uses \'unlisted\' scope when set as preference and replying to a public post', () => {
|
|
|
|
const state = ImmutableMap({ default_privacy: 'unlisted' });
|
|
|
|
const action = {
|
2020-06-30 17:18:26 -07:00
|
|
|
type: actions.COMPOSE_REPLY,
|
2020-06-16 14:58:09 -07:00
|
|
|
status: ImmutableMap({ visibility: 'public' }),
|
|
|
|
account: ImmutableMap(),
|
|
|
|
};
|
|
|
|
expect(reducer(state, action).toJS()).toMatchObject({ privacy: 'unlisted' });
|
|
|
|
});
|
|
|
|
|
|
|
|
it('sets preferred scope on user login', () => {
|
|
|
|
const state = ImmutableMap({ default_privacy: 'public' });
|
|
|
|
const action = {
|
|
|
|
type: ME_FETCH_SUCCESS,
|
|
|
|
me: { pleroma: { settings_store: { soapbox_fe: { defaultPrivacy: 'unlisted' } } } },
|
|
|
|
};
|
|
|
|
expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
default_privacy: 'unlisted',
|
|
|
|
privacy: 'unlisted',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('sets preferred scope on settings change', () => {
|
|
|
|
const state = ImmutableMap({ default_privacy: 'public' });
|
|
|
|
const action = {
|
|
|
|
type: SETTING_CHANGE,
|
|
|
|
path: ['defaultPrivacy'],
|
|
|
|
value: 'unlisted',
|
|
|
|
};
|
|
|
|
expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
default_privacy: 'unlisted',
|
|
|
|
privacy: 'unlisted',
|
|
|
|
});
|
|
|
|
});
|
2020-06-16 15:55:41 -07:00
|
|
|
|
|
|
|
it('sets default scope on settings save (but retains current scope)', () => {
|
|
|
|
const state = ImmutableMap({ default_privacy: 'public', privacy: 'public' });
|
|
|
|
const action = {
|
|
|
|
type: ME_PATCH_SUCCESS,
|
|
|
|
me: { pleroma: { settings_store: { soapbox_fe: { defaultPrivacy: 'unlisted' } } } },
|
|
|
|
};
|
|
|
|
expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
default_privacy: 'unlisted',
|
|
|
|
privacy: 'public',
|
|
|
|
});
|
|
|
|
});
|
2020-06-30 17:18:26 -07:00
|
|
|
|
|
|
|
// it('should handle STORE_HYDRATE', () => {
|
|
|
|
// const state = ImmutableMap({ compose: 'public' });
|
|
|
|
// const action = {
|
|
|
|
// type: STORE_HYDRATE,
|
|
|
|
// };
|
|
|
|
// expect(reducer.hydrate(state, action.toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
it('should handle COMPOSE_MOUNT', () => {
|
|
|
|
const state = ImmutableMap({ mounted: 1 });
|
|
|
|
const action = {
|
|
|
|
type: actions.COMPOSE_MOUNT,
|
|
|
|
};
|
|
|
|
expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
mounted: 2,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2020-07-01 14:40:15 -07:00
|
|
|
it('should handle COMPOSE_UNMOUNT', () => {
|
|
|
|
const state = ImmutableMap({ mounted: 1, is_composing: true });
|
|
|
|
const action = {
|
|
|
|
type: actions.COMPOSE_UNMOUNT,
|
|
|
|
};
|
|
|
|
expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
mounted: 0,
|
|
|
|
is_composing: false,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should handle COMPOSE_SENSITIVITY_CHANGE, with sensitive icon click to toggle, with spoiler active', () => {
|
|
|
|
const state = ImmutableMap({ spoiler: true, sensitive: true });
|
|
|
|
const action = {
|
|
|
|
type: actions.COMPOSE_SENSITIVITY_CHANGE,
|
|
|
|
};
|
|
|
|
expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
sensitive: true,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should handle COMPOSE_SENSITIVITY_CHANGE, with sensitive icon click to toggle, with spoiler inactive', () => {
|
|
|
|
const state = ImmutableMap({ spoiler: false, sensitive: true });
|
|
|
|
const action = {
|
|
|
|
type: actions.COMPOSE_SENSITIVITY_CHANGE,
|
|
|
|
};
|
|
|
|
expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
sensitive: false,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2020-06-30 17:18:26 -07:00
|
|
|
// it('should handle COMPOSE_SPOILERNESS_CHANGE', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_SPOILERNESS_CHANGE,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_SPOILER_TEXT_CHANGE', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_SPOILER_TEXT_CHANGE,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_VISIBILITY_CHANGE', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_VISIBILITY_CHANGE,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_CHANGE', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_CHANGE,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_COMPOSING_CHANGE', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_COMPOSING_CHANGE,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_SUBMIT_REQUEST', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_SUBMIT_REQUEST,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_UPLOAD_CHANGE_REQUEST', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_UPLOAD_CHANGE_REQUEST,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_SUBMIT_SUCCESS', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_SUBMIT_SUCCESS,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_SUBMIT_FAIL', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_SUBMIT_FAIL,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_UPLOAD_CHANGE_FAIL', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_UPLOAD_CHANGE_FAIL,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_UPLOAD_REQUEST', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_UPLOAD_REQUEST,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_UPLOAD_SUCCESS', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_UPLOAD_SUCCESS,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_UPLOAD_FAIL', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_UPLOAD_FAIL,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_UPLOAD_UNDO', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_UPLOAD_UNDO,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_UPLOAD_PROGRESS', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_UPLOAD_PROGRESS,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_MENTION', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_MENTION,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_DIRECT', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_DIRECT,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_SUGGESTIONS_CLEAR', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_SUGGESTIONS_CLEAR,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_SUGGESTIONS_READY', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_SUGGESTIONS_READY,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_SUGGESTION_SELECT', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_SUGGESTION_SELECT,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_SUGGESTION_TAGS_UPDATE', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_SUGGESTION_TAGS_UPDATE,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_TAG_HISTORY_UPDATE', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_TAG_HISTORY_UPDATE,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle TIMELINE_DELETE', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: TIMELINE_DELETE,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_EMOJI_INSERT', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_EMOJI_INSERT,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_UPLOAD_CHANGE_SUCCESS', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_UPLOAD_CHANGE_SUCCESS,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle REDRAFT', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: REDRAFT,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_POLL_ADD', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_POLL_ADD,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_POLL_REMOVE', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_POLL_REMOVE,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_POLL_OPTION_ADD', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_POLL_OPTION_ADD,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_POLL_OPTION_CHANGE', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_POLL_OPTION_CHANGE,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_POLL_OPTION_REMOVE', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_POLL_OPTION_REMOVE,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
//
|
|
|
|
// it('should handle COMPOSE_POLL_SETTINGS_CHANGE', () => {
|
2020-07-01 14:40:15 -07:00
|
|
|
// const state = ImmutableMap({ default_privacy: 'public' });
|
2020-06-30 17:18:26 -07:00
|
|
|
// const action = {
|
|
|
|
// type: actions.COMPOSE_POLL_SETTINGS_CHANGE,
|
|
|
|
// };
|
|
|
|
// expect(reducer(state, action).toJS()).toMatchObject({
|
|
|
|
// default_privacy: 'unlisted',
|
|
|
|
// privacy: 'public',
|
|
|
|
// });
|
|
|
|
// });
|
2020-06-09 18:08:07 -07:00
|
|
|
});
|