1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-09-01 19:42:03 +03:00

Step 3.1: Stop using getComponent in tests

This commit is contained in:
Travis Ralston
2022-03-02 14:09:24 -07:00
parent 15b84bd9a6
commit 26dc2ba45e
23 changed files with 27 additions and 63 deletions

View File

@@ -19,17 +19,14 @@ import ReactDOM from 'react-dom';
import ReactTestUtils from 'react-dom/test-utils';
import { createClient } from 'matrix-js-sdk/src/matrix';
import sdk from '../../../skinned-sdk';
import SdkConfig, { DEFAULTS } from '../../../../src/SdkConfig';
import { createTestClient, mkServerConfig } from "../../../test-utils";
import Registration from "../../../../src/components/structures/auth/Registration";
import RegistrationForm from "../../../../src/components/views/auth/RegistrationForm";
jest.mock('matrix-js-sdk/src/matrix');
jest.useFakeTimers();
const Registration = sdk.getComponent(
'structures.auth.Registration',
);
describe('Registration', function() {
let parentDiv;
@@ -79,7 +76,7 @@ describe('Registration', function() {
const form = ReactTestUtils.findRenderedComponentWithType(
root,
sdk.getComponent('auth.RegistrationForm'),
RegistrationForm,
);
expect(form).toBeTruthy();
});