You've already forked matrix-react-sdk
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:
@@ -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();
|
||||
});
|
||||
|
Reference in New Issue
Block a user