Add Reply in thread button to the right-click message context-menu (#9004)

This commit is contained in:
Šimon Brandner 2022-07-23 14:13:49 +02:00 committed by GitHub
parent dfa844a035
commit 787ace9dc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 236 additions and 56 deletions

View file

@ -41,12 +41,8 @@ import dispatcher from '../../../../src/dispatcher/dispatcher';
import SettingsStore from '../../../../src/settings/SettingsStore';
import { Action } from '../../../../src/dispatcher/actions';
import { UserTab } from '../../../../src/components/views/dialogs/UserTab';
import { showThread } from '../../../../src/dispatcher/dispatch-actions/threads';
jest.mock('../../../../src/dispatcher/dispatcher');
jest.mock('../../../../src/dispatcher/dispatch-actions/threads', () => ({
showThread: jest.fn(),
}));
describe('<MessageActionBar />', () => {
const userId = '@alice:server.org';
@ -447,7 +443,8 @@ describe('<MessageActionBar />', () => {
fireEvent.click(getByLabelText('Reply in thread'));
});
expect(showThread).toHaveBeenCalledWith({
expect(dispatcher.dispatch).toHaveBeenCalledWith({
action: Action.ShowThread,
rootEvent: alicesMessageEvent,
push: false,
});
@ -475,7 +472,8 @@ describe('<MessageActionBar />', () => {
fireEvent.click(getByLabelText('Reply in thread'));
});
expect(showThread).toHaveBeenCalledWith({
expect(dispatcher.dispatch).toHaveBeenCalledWith({
action: Action.ShowThread,
rootEvent: alicesMessageEvent,
initialEvent: threadReplyEvent,
highlighted: true,