Update Enzyme adapter name
This commit is contained in:
parent
85d1bb65c6
commit
d492ee4d8a
4 changed files with 19 additions and 19 deletions
|
@ -16,7 +16,7 @@ limitations under the License.
|
||||||
|
|
||||||
import '../skinned-sdk'; // Must be first for skinning to work
|
import '../skinned-sdk'; // Must be first for skinning to work
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import Adapter from "enzyme-adapter-react-16";
|
import Adapter from "@wojtekmaj/enzyme-adapter-react-17";
|
||||||
import { configure, mount } from "enzyme";
|
import { configure, mount } from "enzyme";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -32,7 +32,7 @@ import Matrix from 'matrix-js-sdk';
|
||||||
const test_utils = require('../../test-utils');
|
const test_utils = require('../../test-utils');
|
||||||
const mockclock = require('../../mock-clock');
|
const mockclock = require('../../mock-clock');
|
||||||
|
|
||||||
import Adapter from "enzyme-adapter-react-16";
|
import Adapter from "@wojtekmaj/enzyme-adapter-react-17";
|
||||||
import { configure, mount } from "enzyme";
|
import { configure, mount } from "enzyme";
|
||||||
|
|
||||||
import MatrixClientContext from "../../../src/contexts/MatrixClientContext";
|
import MatrixClientContext from "../../../src/contexts/MatrixClientContext";
|
||||||
|
@ -77,7 +77,7 @@ describe('MessagePanel', function() {
|
||||||
DMRoomMap.makeShared();
|
DMRoomMap.makeShared();
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function () {
|
afterEach(function() {
|
||||||
clock.uninstall();
|
clock.uninstall();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@ describe('MessagePanel', function() {
|
||||||
|
|
||||||
it('should show the events', function() {
|
it('should show the events', function() {
|
||||||
const res = TestUtils.renderIntoDocument(
|
const res = TestUtils.renderIntoDocument(
|
||||||
<WrappedMessagePanel className="cls" events={events} />,
|
<WrappedMessagePanel className="cls" events={events} />,
|
||||||
);
|
);
|
||||||
|
|
||||||
// just check we have the right number of tiles for now
|
// just check we have the right number of tiles for now
|
||||||
|
@ -298,8 +298,8 @@ describe('MessagePanel', function() {
|
||||||
|
|
||||||
it('should insert the read-marker in the right place', function() {
|
it('should insert the read-marker in the right place', function() {
|
||||||
const res = TestUtils.renderIntoDocument(
|
const res = TestUtils.renderIntoDocument(
|
||||||
<WrappedMessagePanel className="cls" events={events} readMarkerEventId={events[4].getId()}
|
<WrappedMessagePanel className="cls" events={events} readMarkerEventId={events[4].getId()}
|
||||||
readMarkerVisible={true} />,
|
readMarkerVisible={true} />,
|
||||||
);
|
);
|
||||||
|
|
||||||
const tiles = TestUtils.scryRenderedComponentsWithType(
|
const tiles = TestUtils.scryRenderedComponentsWithType(
|
||||||
|
@ -316,8 +316,8 @@ describe('MessagePanel', function() {
|
||||||
it('should show the read-marker that fall in summarised events after the summary', function() {
|
it('should show the read-marker that fall in summarised events after the summary', function() {
|
||||||
const melsEvents = mkMelsEvents();
|
const melsEvents = mkMelsEvents();
|
||||||
const res = TestUtils.renderIntoDocument(
|
const res = TestUtils.renderIntoDocument(
|
||||||
<WrappedMessagePanel className="cls" events={melsEvents} readMarkerEventId={melsEvents[4].getId()}
|
<WrappedMessagePanel className="cls" events={melsEvents} readMarkerEventId={melsEvents[4].getId()}
|
||||||
readMarkerVisible={true} />,
|
readMarkerVisible={true} />,
|
||||||
);
|
);
|
||||||
|
|
||||||
const summary = TestUtils.findRenderedDOMComponentWithClass(res, 'mx_EventListSummary');
|
const summary = TestUtils.findRenderedDOMComponentWithClass(res, 'mx_EventListSummary');
|
||||||
|
@ -334,8 +334,8 @@ describe('MessagePanel', function() {
|
||||||
it('should hide the read-marker at the end of summarised events', function() {
|
it('should hide the read-marker at the end of summarised events', function() {
|
||||||
const melsEvents = mkMelsEventsOnly();
|
const melsEvents = mkMelsEventsOnly();
|
||||||
const res = TestUtils.renderIntoDocument(
|
const res = TestUtils.renderIntoDocument(
|
||||||
<WrappedMessagePanel className="cls" events={melsEvents} readMarkerEventId={melsEvents[9].getId()}
|
<WrappedMessagePanel className="cls" events={melsEvents} readMarkerEventId={melsEvents[9].getId()}
|
||||||
readMarkerVisible={true} />,
|
readMarkerVisible={true} />,
|
||||||
);
|
);
|
||||||
|
|
||||||
const summary = TestUtils.findRenderedDOMComponentWithClass(res, 'mx_EventListSummary');
|
const summary = TestUtils.findRenderedDOMComponentWithClass(res, 'mx_EventListSummary');
|
||||||
|
@ -358,9 +358,9 @@ describe('MessagePanel', function() {
|
||||||
|
|
||||||
// first render with the RM in one place
|
// first render with the RM in one place
|
||||||
let mp = ReactDOM.render(
|
let mp = ReactDOM.render(
|
||||||
<WrappedMessagePanel className="cls" events={events} readMarkerEventId={events[4].getId()}
|
<WrappedMessagePanel className="cls" events={events} readMarkerEventId={events[4].getId()}
|
||||||
readMarkerVisible={true}
|
readMarkerVisible={true}
|
||||||
/>, parentDiv);
|
/>, parentDiv);
|
||||||
|
|
||||||
const tiles = TestUtils.scryRenderedComponentsWithType(
|
const tiles = TestUtils.scryRenderedComponentsWithType(
|
||||||
mp, sdk.getComponent('rooms.EventTile'));
|
mp, sdk.getComponent('rooms.EventTile'));
|
||||||
|
@ -374,9 +374,9 @@ describe('MessagePanel', function() {
|
||||||
|
|
||||||
// now move the RM
|
// now move the RM
|
||||||
mp = ReactDOM.render(
|
mp = ReactDOM.render(
|
||||||
<WrappedMessagePanel className="cls" events={events} readMarkerEventId={events[6].getId()}
|
<WrappedMessagePanel className="cls" events={events} readMarkerEventId={events[6].getId()}
|
||||||
readMarkerVisible={true}
|
readMarkerVisible={true}
|
||||||
/>, parentDiv);
|
/>, parentDiv);
|
||||||
|
|
||||||
// now there should be two RM containers
|
// now there should be two RM containers
|
||||||
const found = TestUtils.scryRenderedDOMComponentsWithClass(mp, 'mx_RoomView_myReadMarker_container');
|
const found = TestUtils.scryRenderedDOMComponentsWithClass(mp, 'mx_RoomView_myReadMarker_container');
|
||||||
|
@ -451,7 +451,7 @@ describe('MessagePanel', function() {
|
||||||
expect(isReadMarkerVisible(rm)).toBeFalsy();
|
expect(isReadMarkerVisible(rm)).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render Date separators for the events', function () {
|
it('should render Date separators for the events', function() {
|
||||||
const events = mkOneDayEvents();
|
const events = mkOneDayEvents();
|
||||||
const res = mount(
|
const res = mount(
|
||||||
<WrappedMessagePanel
|
<WrappedMessagePanel
|
||||||
|
|
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import Adapter from "enzyme-adapter-react-16";
|
import Adapter from "@wojtekmaj/enzyme-adapter-react-17";
|
||||||
import { configure, mount } from "enzyme";
|
import { configure, mount } from "enzyme";
|
||||||
|
|
||||||
import sdk from "../../../skinned-sdk";
|
import sdk from "../../../skinned-sdk";
|
||||||
|
|
|
@ -15,7 +15,7 @@ limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import '../../../skinned-sdk'; // Must be first for skinning to work
|
import '../../../skinned-sdk'; // Must be first for skinning to work
|
||||||
import Adapter from "enzyme-adapter-react-16";
|
import Adapter from "@wojtekmaj/enzyme-adapter-react-17";
|
||||||
import { configure, mount } from "enzyme";
|
import { configure, mount } from "enzyme";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {act} from "react-dom/test-utils";
|
import {act} from "react-dom/test-utils";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue