You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
Unit test tsc fixes part 15 (#8104)
* fix ts issues in MPollBody test Signed-off-by: Kerry Archibald <kerrya@element.io> * fix ts issues in PollCreateDialog Signed-off-by: Kerry Archibald <kerrya@element.io> * fix settings components Signed-off-by: Kerry Archibald <kerrya@element.io> * fix DateSeparator Signed-off-by: Kerry Archibald <kerrya@element.io> * fix loosies Signed-off-by: Kerry Archibald <kerrya@element.io> * update tsconfig Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// skinned-sdk should be the first import in most tests
|
||||
import '../../../skinned-sdk';
|
||||
import React from "react";
|
||||
import { mocked } from 'jest-mock';
|
||||
import {
|
||||
renderIntoDocument,
|
||||
Simulate,
|
||||
@@ -53,11 +54,10 @@ describe('<SpaceSettingsVisibilityTab />', () => {
|
||||
];
|
||||
const space = mkSpace(client, mockSpaceId);
|
||||
const getStateEvents = mockStateEventImplementation(events);
|
||||
space.currentState.getStateEvents.mockImplementation(getStateEvents);
|
||||
space.currentState.mayClientSendStateEvent.mockReturnValue(false);
|
||||
const mockGetJoinRule = jest.fn().mockReturnValue(joinRule);
|
||||
space.getJoinRule = mockGetJoinRule;
|
||||
space.currentState.getJoinRule = mockGetJoinRule;
|
||||
mocked(space.currentState).getStateEvents.mockImplementation(getStateEvents);
|
||||
mocked(space.currentState).mayClientSendStateEvent.mockReturnValue(false);
|
||||
space.getJoinRule.mockReturnValue(joinRule);
|
||||
mocked(space.currentState).getJoinRule.mockReturnValue(joinRule);
|
||||
return space as unknown as Room;
|
||||
};
|
||||
const defaultProps = {
|
||||
@@ -70,6 +70,7 @@ describe('<SpaceSettingsVisibilityTab />', () => {
|
||||
const wrapper = renderIntoDocument<HTMLSpanElement>(
|
||||
// wrap in element so renderIntoDocument can render functional component
|
||||
<span>
|
||||
{ /* @ts-ignore */ }
|
||||
<SpaceSettingsVisibilityTab {...defaultProps} {...props} />
|
||||
</span>,
|
||||
) as HTMLSpanElement;
|
||||
|
Reference in New Issue
Block a user