mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-28 04:21:00 +00:00
Fix tsc issues in right_panel and room component tests (#8078)
* fix ts issues in SendMessageComposer-test Signed-off-by: Kerry Archibald <kerrya@element.io> * remove empty file Signed-off-by: Kerry Archibald <kerrya@element.io> * fix tsc issues in MessageComposerbUttons-test Signed-off-by: Kerry Archibald <kerrya@element.io> * fix the rest Signed-off-by: Kerry Archibald <kerrya@element.io> * bad autoformatter Signed-off-by: Kerry Archibald <kerrya@element.io> * tsc fixes for test/components/views/right_panel Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
@@ -28,13 +28,14 @@ import * as TestUtils from '../../../test-utils';
|
||||
import { compare } from "../../../../src/utils/strings";
|
||||
import MemberList from "../../../../src/components/views/rooms/MemberList";
|
||||
import MemberTile from '../../../../src/components/views/rooms/MemberTile';
|
||||
import MatrixClientContext from "../../../../src/contexts/MatrixClientContext";
|
||||
|
||||
function generateRoomId() {
|
||||
return '!' + Math.random().toString().slice(2, 10) + ':domain';
|
||||
}
|
||||
|
||||
describe('MemberList', () => {
|
||||
function createRoom(opts) {
|
||||
function createRoom(opts = {}) {
|
||||
const room = new Room(generateRoomId(), null, client.getUserId());
|
||||
if (opts) {
|
||||
Object.assign(room, opts);
|
||||
@@ -114,16 +115,20 @@ describe('MemberList', () => {
|
||||
memberListRoom.currentState.members[member.userId] = member;
|
||||
}
|
||||
|
||||
const WrappedMemberList = TestUtils.wrapInMatrixClientContext(MemberList);
|
||||
const gatherWrappedRef = (r) => {
|
||||
memberList = r;
|
||||
};
|
||||
root = ReactDOM.render(
|
||||
(
|
||||
<WrappedMemberList
|
||||
roomId={memberListRoom.roomId}
|
||||
wrappedRef={gatherWrappedRef}
|
||||
/>
|
||||
<MatrixClientContext.Provider value={client}>
|
||||
<MemberList
|
||||
searchQuery=""
|
||||
onClose={jest.fn()}
|
||||
onSearchQueryChanged={jest.fn()}
|
||||
roomId={memberListRoom.roomId}
|
||||
ref={gatherWrappedRef}
|
||||
/>
|
||||
</MatrixClientContext.Provider>
|
||||
),
|
||||
parentDiv,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user