From accb0abe2dbef874aa6e5c80777e75d3db60d828 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 24 Aug 2019 11:47:07 +0100 Subject: [PATCH] Switch from react-addons-test-utils to react-dom/test-utils. React 16 :D Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- package.json | 1 - test/components/structures/MessagePanel-test.js | 2 +- test/components/views/dialogs/InteractiveAuthDialog-test.js | 2 +- .../components/views/elements/MemberEventListSummary-test.js | 2 +- test/components/views/rooms/MemberList-test.js | 2 +- test/components/views/rooms/MessageComposerInput-test.js | 5 ++--- test/components/views/rooms/RoomList-test.js | 2 +- yarn.lock | 5 ----- 8 files changed, 7 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index ffd701a233..b4e1af9f0a 100644 --- a/package.json +++ b/package.json @@ -150,7 +150,6 @@ "matrix-mock-request": "^1.2.3", "matrix-react-test-utils": "^0.2.2", "mocha": "^5.0.5", - "react-addons-test-utils": "^15.4.0", "require-json": "0.0.1", "rimraf": "^2.4.3", "sinon": "^5.0.7", diff --git a/test/components/structures/MessagePanel-test.js b/test/components/structures/MessagePanel-test.js index 138681457c..58b1590cf1 100644 --- a/test/components/structures/MessagePanel-test.js +++ b/test/components/structures/MessagePanel-test.js @@ -19,7 +19,7 @@ import SettingsStore from "../../../src/settings/SettingsStore"; const React = require('react'); const ReactDOM = require("react-dom"); import PropTypes from "prop-types"; -const TestUtils = require('react-addons-test-utils'); +const TestUtils = require('react-dom/test-utils'); const expect = require('expect'); import sinon from 'sinon'; import { EventEmitter } from "events"; diff --git a/test/components/views/dialogs/InteractiveAuthDialog-test.js b/test/components/views/dialogs/InteractiveAuthDialog-test.js index 95f76dfd3e..b14ea7c242 100644 --- a/test/components/views/dialogs/InteractiveAuthDialog-test.js +++ b/test/components/views/dialogs/InteractiveAuthDialog-test.js @@ -18,7 +18,7 @@ import expect from 'expect'; import Promise from 'bluebird'; import React from 'react'; import ReactDOM from 'react-dom'; -import ReactTestUtils from 'react-addons-test-utils'; +import ReactTestUtils from 'react-dom/test-utils'; import sinon from 'sinon'; import MatrixReactTestUtils from 'matrix-react-test-utils'; diff --git a/test/components/views/elements/MemberEventListSummary-test.js b/test/components/views/elements/MemberEventListSummary-test.js index f3749b850f..d1e112735d 100644 --- a/test/components/views/elements/MemberEventListSummary-test.js +++ b/test/components/views/elements/MemberEventListSummary-test.js @@ -1,6 +1,6 @@ import expect from 'expect'; import React from 'react'; -import ReactTestUtils from 'react-addons-test-utils'; +import ReactTestUtils from 'react-dom/test-utils'; import sdk from 'matrix-react-sdk'; import * as languageHandler from '../../../../src/languageHandler'; import * as testUtils from '../../../test-utils'; diff --git a/test/components/views/rooms/MemberList-test.js b/test/components/views/rooms/MemberList-test.js index b9d96635a2..9a1439c2f7 100644 --- a/test/components/views/rooms/MemberList-test.js +++ b/test/components/views/rooms/MemberList-test.js @@ -1,5 +1,5 @@ import React from 'react'; -import ReactTestUtils from 'react-addons-test-utils'; +import ReactTestUtils from 'react-dom/test-utils'; import ReactDOM from 'react-dom'; import expect from 'expect'; import lolex from 'lolex'; diff --git a/test/components/views/rooms/MessageComposerInput-test.js b/test/components/views/rooms/MessageComposerInput-test.js index ed07c0f233..1105a4af17 100644 --- a/test/components/views/rooms/MessageComposerInput-test.js +++ b/test/components/views/rooms/MessageComposerInput-test.js @@ -1,5 +1,5 @@ import React from 'react'; -import ReactTestUtils from 'react-addons-test-utils'; +import ReactTestUtils from 'react-dom/test-utils'; import ReactDOM from 'react-dom'; import expect from 'expect'; import sinon from 'sinon'; @@ -8,7 +8,6 @@ import * as testUtils from '../../../test-utils'; import sdk from 'matrix-react-sdk'; const MessageComposerInput = sdk.getComponent('views.rooms.MessageComposerInput'); import MatrixClientPeg from '../../../../src/MatrixClientPeg'; -import RoomMember from 'matrix-js-sdk'; function addTextToDraft(text) { const components = document.getElementsByClassName('public-DraftEditor-content'); @@ -301,4 +300,4 @@ xdescribe('MessageComposerInput', () => { expect(spy.args[0][1].body).toEqual('[Click here](https://some.lovely.url)'); expect(spy.args[0][1].formatted_body).toEqual('Click here'); }); -}); \ No newline at end of file +}); diff --git a/test/components/views/rooms/RoomList-test.js b/test/components/views/rooms/RoomList-test.js index 754367cd23..68168fcf29 100644 --- a/test/components/views/rooms/RoomList-test.js +++ b/test/components/views/rooms/RoomList-test.js @@ -1,5 +1,5 @@ import React from 'react'; -import ReactTestUtils from 'react-addons-test-utils'; +import ReactTestUtils from 'react-dom/test-utils'; import ReactDOM from 'react-dom'; import expect from 'expect'; import lolex from 'lolex'; diff --git a/yarn.lock b/yarn.lock index b9341b2a0e..c664d0b7dc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6349,11 +6349,6 @@ react-addons-css-transition-group@15.3.2: resolved "https://registry.yarnpkg.com/react-addons-css-transition-group/-/react-addons-css-transition-group-15.3.2.tgz#d8fa52bec9bb61bdfde8b9e4652b80297cbff667" integrity sha1-2PpSvsm7Yb396LnkZSuAKXy/9mc= -react-addons-test-utils@^15.4.0: - version "15.6.2" - resolved "https://registry.yarnpkg.com/react-addons-test-utils/-/react-addons-test-utils-15.6.2.tgz#c12b6efdc2247c10da7b8770d185080a7b047156" - integrity sha1-wStu/cIkfBDae4dw0YUICnsEcVY= - react-beautiful-dnd@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/react-beautiful-dnd/-/react-beautiful-dnd-4.0.1.tgz#3b0a49bf6be75af351176c904f012611dd292b81"