Standardize on showConversation function, delete unused functions

This commit is contained in:
Scott Nonnenberg 2022-12-14 11:05:32 -08:00 committed by GitHub
parent 1dc3ed914f
commit f2f1c3c021
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 174 additions and 198 deletions

View file

@ -3,7 +3,9 @@
import { assert } from 'chai';
import * as sinon from 'sinon';
import { noop } from 'lodash';
import type { ReduxActions } from '../../../state/types';
import { actions, getEmptyState, reducer } from '../../../state/ducks/composer';
import { noopAction } from '../../../state/ducks/noop';
import { reducer as rootReducer } from '../../../state/reducer';
@ -38,6 +40,22 @@ describe('both/state/ducks/composer', () => {
};
describe('replaceAttachments', () => {
let oldReduxActions: ReduxActions;
before(() => {
oldReduxActions = window.reduxActions;
window.reduxActions = {
...oldReduxActions,
linkPreviews: {
...oldReduxActions?.linkPreviews,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
removeLinkPreview: noop as any,
},
};
});
after(() => {
window.reduxActions = oldReduxActions;
});
it('replaces the attachments state', () => {
const { replaceAttachments } = actions;
const dispatch = sinon.spy();