Wire up new fields on the ViewRoom posthog event and more interactions (#7787)
This commit is contained in:
parent
9141225a79
commit
cfa6e266cd
10 changed files with 54 additions and 11 deletions
|
@ -16,6 +16,7 @@ limitations under the License.
|
|||
|
||||
import { MatrixEvent } from 'matrix-js-sdk';
|
||||
|
||||
import './skinned-sdk'; // Must be first for skinning to work
|
||||
import { DecryptionFailureTracker } from '../src/DecryptionFailureTracker';
|
||||
|
||||
class MockDecryptionError extends Error {
|
||||
|
|
|
@ -17,10 +17,10 @@ limitations under the License.
|
|||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { mocked } from 'jest-mock';
|
||||
import '../../../skinned-sdk';
|
||||
import { act } from "react-dom/test-utils";
|
||||
import { Room } from 'matrix-js-sdk';
|
||||
|
||||
import '../../../skinned-sdk';
|
||||
import ExportDialog from '../../../../src/components/views/dialogs/ExportDialog';
|
||||
import { ExportType, ExportFormat } from '../../../../src/utils/exportUtils/exportUtils';
|
||||
import { createTestClient, mkStubRoom } from '../../../test-utils';
|
||||
|
|
|
@ -14,13 +14,13 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import '../../../skinned-sdk'; // Must be first for skinning to work
|
||||
import React from "react";
|
||||
import { act } from "react-dom/test-utils";
|
||||
import { sleep } from "matrix-js-sdk/src/utils";
|
||||
import { mount } from 'enzyme';
|
||||
import { RelationType } from 'matrix-js-sdk/src/@types/event';
|
||||
|
||||
import '../../../skinned-sdk'; // Must be first for skinning to work
|
||||
import SendMessageComposer, {
|
||||
createMessageContent,
|
||||
isQuickReaction,
|
||||
|
@ -38,8 +38,6 @@ import defaultDispatcher from "../../../../src/dispatcher/dispatcher";
|
|||
import DocumentOffset from '../../../../src/editor/offset';
|
||||
import { Layout } from '../../../../src/settings/enums/Layout';
|
||||
|
||||
jest.mock("../../../../src/stores/RoomViewStore");
|
||||
|
||||
describe('<SendMessageComposer/>', () => {
|
||||
const roomContext = {
|
||||
roomLoading: true,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import '../skinned-sdk'; // Must be first for skinning to work
|
||||
import RoomViewStore from '../../src/stores/RoomViewStore';
|
||||
import { Action } from '../../src/dispatcher/actions';
|
||||
import { MatrixClientPeg as peg } from '../../src/MatrixClientPeg';
|
||||
|
@ -5,6 +6,18 @@ import * as testUtils from '../test-utils';
|
|||
|
||||
const dispatch = testUtils.getDispatchForStore(RoomViewStore);
|
||||
|
||||
jest.mock('../../src/utils/DMRoomMap', () => {
|
||||
const mock = {
|
||||
getUserIdForRoomId: jest.fn(),
|
||||
getDMRoomsForUserId: jest.fn(),
|
||||
};
|
||||
|
||||
return {
|
||||
shared: jest.fn().mockReturnValue(mock),
|
||||
sharedInstance: mock,
|
||||
};
|
||||
});
|
||||
|
||||
describe('RoomViewStore', function() {
|
||||
beforeEach(function() {
|
||||
testUtils.stubClient();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue