From ef436b8fa77db17d2b916180fe043610a7158fda Mon Sep 17 00:00:00 2001 From: Dariusz Niemczyk Date: Fri, 1 Oct 2021 15:41:28 +0200 Subject: [PATCH] Revert "Fix joining-test" This reverts commit ecf29d9409eaa35da29b0c1be73bd1389f00aae7. --- test/app-tests/joining-test.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/app-tests/joining-test.tsx b/test/app-tests/joining-test.tsx index b5601875b9..744037325c 100644 --- a/test/app-tests/joining-test.tsx +++ b/test/app-tests/joining-test.tsx @@ -31,12 +31,12 @@ import {sleep} from "../test-utils"; import * as test_utils from "../test-utils"; import MockHttpBackend from "matrix-mock-request"; import "fake-indexeddb/auto"; -import { RoomView as RoomViewClass } from 'matrix-react-sdk/src/components/structures/RoomView'; const MatrixChat = sdk.getComponent('structures.MatrixChat'); const RoomDirectory = sdk.getComponent('structures.RoomDirectory'); const RoomPreviewBar = sdk.getComponent('rooms.RoomPreviewBar'); +const RoomView = sdk.getComponent('structures.RoomView'); const HS_URL='http://localhost'; const IS_URL='http://localhost'; @@ -50,6 +50,7 @@ describe('joining a room', function() { let matrixChat; beforeEach(function() { + test_utils.beforeEach(this); httpBackend = new MockHttpBackend(); jssdk.request(httpBackend.requestFn); parentDiv = document.createElement('div'); @@ -147,7 +148,7 @@ describe('joining a room', function() { // enter an alias in the input, and simulate enter const input = ReactTestUtils.findRenderedDOMComponentWithTag( - roomDir, 'input') as HTMLInputElement; + roomDir, 'input'); input.value = ROOM_ALIAS; ReactTestUtils.Simulate.change(input); ReactTestUtils.Simulate.keyUp(input, {key: 'Enter'}); @@ -164,7 +165,7 @@ describe('joining a room', function() { // we should now have a roomview roomView = ReactTestUtils.findRenderedComponentWithType( - matrixChat, RoomViewClass); + matrixChat, RoomView); // the preview bar may take a tick to be displayed return sleep(1); @@ -227,7 +228,7 @@ describe('joining a room', function() { return httpBackend.flush(); }).then(() => { // now the room should have loaded - expect(roomView.state.room).toBeTruthy(); + expect(roomView.state.room).toExist(); }); }); });