You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
Consolidate RedactionGrouper and HiddenEventGrouper into MELS (#7739)
This commit is contained in:
committed by
GitHub
parent
59cdd3edc0
commit
714136d4f7
@@ -122,8 +122,7 @@ describe('MessagePanel', function() {
|
||||
return events;
|
||||
}
|
||||
|
||||
// make a collection of events with some member events that should be collapsed
|
||||
// with a MemberEventListSummary
|
||||
// make a collection of events with some member events that should be collapsed with an EventListSummary
|
||||
function mkMelsEvents() {
|
||||
const events = [];
|
||||
const ts0 = Date.now();
|
||||
@@ -304,7 +303,7 @@ describe('MessagePanel', function() {
|
||||
expect(tiles.length).toEqual(2);
|
||||
|
||||
const summaryTiles = TestUtils.scryRenderedComponentsWithType(
|
||||
res, sdk.getComponent('elements.MemberEventListSummary'),
|
||||
res, sdk.getComponent('elements.EventListSummary'),
|
||||
);
|
||||
expect(summaryTiles.length).toEqual(1);
|
||||
});
|
||||
@@ -341,7 +340,7 @@ describe('MessagePanel', function() {
|
||||
/>,
|
||||
);
|
||||
|
||||
const summary = TestUtils.findRenderedDOMComponentWithClass(res, 'mx_EventListSummary');
|
||||
const summary = TestUtils.findRenderedDOMComponentWithClass(res, 'mx_GenericEventListSummary');
|
||||
|
||||
// find the <li> which wraps the read marker
|
||||
const rm = TestUtils.findRenderedDOMComponentWithClass(res, 'mx_RoomView_myReadMarker_container');
|
||||
@@ -363,7 +362,7 @@ describe('MessagePanel', function() {
|
||||
/>,
|
||||
);
|
||||
|
||||
const summary = TestUtils.findRenderedDOMComponentWithClass(res, 'mx_EventListSummary');
|
||||
const summary = TestUtils.findRenderedDOMComponentWithClass(res, 'mx_GenericEventListSummary');
|
||||
|
||||
// find the <li> which wraps the read marker
|
||||
const rm = TestUtils.findRenderedDOMComponentWithClass(res, 'mx_RoomView_myReadMarker_container');
|
||||
@@ -450,7 +449,7 @@ describe('MessagePanel', function() {
|
||||
expect(tiles.at(0).props().mxEvent.getType()).toEqual("m.room.create");
|
||||
expect(tiles.at(1).props().mxEvent.getType()).toEqual("m.room.encryption");
|
||||
|
||||
const summaryTiles = res.find(sdk.getComponent('views.elements.EventListSummary'));
|
||||
const summaryTiles = res.find(sdk.getComponent('views.elements.GenericEventListSummary'));
|
||||
const summaryTile = summaryTiles.at(0);
|
||||
|
||||
const summaryEventTiles = summaryTile.find(sdk.getComponent('views.rooms.EventTile'));
|
||||
|
@@ -5,12 +5,10 @@ import ShallowRenderer from "react-test-renderer/shallow";
|
||||
import sdk from '../../../skinned-sdk';
|
||||
import * as testUtils from '../../../test-utils';
|
||||
|
||||
// Give MELS a matrixClient in its child context
|
||||
const MemberEventListSummary = testUtils.wrapInMatrixClientContext(
|
||||
sdk.getComponent('views.elements.MemberEventListSummary'),
|
||||
);
|
||||
// Give ELS a matrixClient in its child context
|
||||
const EventListSummary = testUtils.wrapInMatrixClientContext(sdk.getComponent('views.elements.EventListSummary'));
|
||||
|
||||
describe('MemberEventListSummary', function() {
|
||||
describe('EventListSummary', function() {
|
||||
// Generate dummy event tiles for use in simulating an expanded MELS
|
||||
const generateTiles = (events) => {
|
||||
return events.map((e) => {
|
||||
@@ -102,7 +100,7 @@ describe('MemberEventListSummary', function() {
|
||||
};
|
||||
|
||||
const renderer = new ShallowRenderer();
|
||||
renderer.render(<MemberEventListSummary {...props} />);
|
||||
renderer.render(<EventListSummary {...props} />);
|
||||
const wrapper = renderer.getRenderOutput(); // matrix cli context wrapper
|
||||
const result = wrapper.props.children;
|
||||
|
||||
@@ -125,7 +123,7 @@ describe('MemberEventListSummary', function() {
|
||||
};
|
||||
|
||||
const renderer = new ShallowRenderer();
|
||||
renderer.render(<MemberEventListSummary {...props} />);
|
||||
renderer.render(<EventListSummary {...props} />);
|
||||
const wrapper = renderer.getRenderOutput(); // matrix cli context wrapper
|
||||
const result = wrapper.props.children;
|
||||
|
||||
@@ -150,10 +148,10 @@ describe('MemberEventListSummary', function() {
|
||||
};
|
||||
|
||||
const instance = ReactTestUtils.renderIntoDocument(
|
||||
<MemberEventListSummary {...props} />,
|
||||
<EventListSummary {...props} />,
|
||||
);
|
||||
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
|
||||
instance, "mx_EventListSummary_summary",
|
||||
instance, "mx_GenericEventListSummary_summary",
|
||||
);
|
||||
const summaryText = summary.textContent;
|
||||
|
||||
@@ -186,10 +184,10 @@ describe('MemberEventListSummary', function() {
|
||||
};
|
||||
|
||||
const instance = ReactTestUtils.renderIntoDocument(
|
||||
<MemberEventListSummary {...props} />,
|
||||
<EventListSummary {...props} />,
|
||||
);
|
||||
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
|
||||
instance, "mx_EventListSummary_summary",
|
||||
instance, "mx_GenericEventListSummary_summary",
|
||||
);
|
||||
const summaryText = summary.textContent;
|
||||
|
||||
@@ -234,10 +232,10 @@ describe('MemberEventListSummary', function() {
|
||||
};
|
||||
|
||||
const instance = ReactTestUtils.renderIntoDocument(
|
||||
<MemberEventListSummary {...props} />,
|
||||
<EventListSummary {...props} />,
|
||||
);
|
||||
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
|
||||
instance, "mx_EventListSummary_summary",
|
||||
instance, "mx_GenericEventListSummary_summary",
|
||||
);
|
||||
const summaryText = summary.textContent;
|
||||
|
||||
@@ -286,10 +284,10 @@ describe('MemberEventListSummary', function() {
|
||||
};
|
||||
|
||||
const instance = ReactTestUtils.renderIntoDocument(
|
||||
<MemberEventListSummary {...props} />,
|
||||
<EventListSummary {...props} />,
|
||||
);
|
||||
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
|
||||
instance, "mx_EventListSummary_summary",
|
||||
instance, "mx_GenericEventListSummary_summary",
|
||||
);
|
||||
const summaryText = summary.textContent;
|
||||
|
||||
@@ -345,10 +343,10 @@ describe('MemberEventListSummary', function() {
|
||||
};
|
||||
|
||||
const instance = ReactTestUtils.renderIntoDocument(
|
||||
<MemberEventListSummary {...props} />,
|
||||
<EventListSummary {...props} />,
|
||||
);
|
||||
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
|
||||
instance, "mx_EventListSummary_summary",
|
||||
instance, "mx_GenericEventListSummary_summary",
|
||||
);
|
||||
const summaryText = summary.textContent;
|
||||
|
||||
@@ -383,10 +381,10 @@ describe('MemberEventListSummary', function() {
|
||||
};
|
||||
|
||||
const instance = ReactTestUtils.renderIntoDocument(
|
||||
<MemberEventListSummary {...props} />,
|
||||
<EventListSummary {...props} />,
|
||||
);
|
||||
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
|
||||
instance, "mx_EventListSummary_summary",
|
||||
instance, "mx_GenericEventListSummary_summary",
|
||||
);
|
||||
const summaryText = summary.textContent;
|
||||
|
||||
@@ -433,10 +431,10 @@ describe('MemberEventListSummary', function() {
|
||||
};
|
||||
|
||||
const instance = ReactTestUtils.renderIntoDocument(
|
||||
<MemberEventListSummary {...props} />,
|
||||
<EventListSummary {...props} />,
|
||||
);
|
||||
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
|
||||
instance, "mx_EventListSummary_summary",
|
||||
instance, "mx_GenericEventListSummary_summary",
|
||||
);
|
||||
const summaryText = summary.textContent;
|
||||
|
||||
@@ -507,10 +505,10 @@ describe('MemberEventListSummary', function() {
|
||||
};
|
||||
|
||||
const instance = ReactTestUtils.renderIntoDocument(
|
||||
<MemberEventListSummary {...props} />,
|
||||
<EventListSummary {...props} />,
|
||||
);
|
||||
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
|
||||
instance, "mx_EventListSummary_summary",
|
||||
instance, "mx_GenericEventListSummary_summary",
|
||||
);
|
||||
const summaryText = summary.textContent;
|
||||
|
||||
@@ -554,10 +552,10 @@ describe('MemberEventListSummary', function() {
|
||||
};
|
||||
|
||||
const instance = ReactTestUtils.renderIntoDocument(
|
||||
<MemberEventListSummary {...props} />,
|
||||
<EventListSummary {...props} />,
|
||||
);
|
||||
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
|
||||
instance, "mx_EventListSummary_summary",
|
||||
instance, "mx_GenericEventListSummary_summary",
|
||||
);
|
||||
const summaryText = summary.textContent;
|
||||
|
||||
@@ -589,10 +587,10 @@ describe('MemberEventListSummary', function() {
|
||||
};
|
||||
|
||||
const instance = ReactTestUtils.renderIntoDocument(
|
||||
<MemberEventListSummary {...props} />,
|
||||
<EventListSummary {...props} />,
|
||||
);
|
||||
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
|
||||
instance, "mx_EventListSummary_summary",
|
||||
instance, "mx_GenericEventListSummary_summary",
|
||||
);
|
||||
const summaryText = summary.textContent;
|
||||
|
||||
@@ -617,10 +615,10 @@ describe('MemberEventListSummary', function() {
|
||||
};
|
||||
|
||||
const instance = ReactTestUtils.renderIntoDocument(
|
||||
<MemberEventListSummary {...props} />,
|
||||
<EventListSummary {...props} />,
|
||||
);
|
||||
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
|
||||
instance, "mx_EventListSummary_summary",
|
||||
instance, "mx_GenericEventListSummary_summary",
|
||||
);
|
||||
const summaryText = summary.textContent;
|
||||
|
||||
@@ -644,10 +642,10 @@ describe('MemberEventListSummary', function() {
|
||||
};
|
||||
|
||||
const instance = ReactTestUtils.renderIntoDocument(
|
||||
<MemberEventListSummary {...props} />,
|
||||
<EventListSummary {...props} />,
|
||||
);
|
||||
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
|
||||
instance, "mx_EventListSummary_summary",
|
||||
instance, "mx_GenericEventListSummary_summary",
|
||||
);
|
||||
const summaryText = summary.textContent;
|
||||
|
||||
@@ -669,10 +667,10 @@ describe('MemberEventListSummary', function() {
|
||||
};
|
||||
|
||||
const instance = ReactTestUtils.renderIntoDocument(
|
||||
<MemberEventListSummary {...props} />,
|
||||
<EventListSummary {...props} />,
|
||||
);
|
||||
const summary = ReactTestUtils.findRenderedDOMComponentWithClass(
|
||||
instance, "mx_EventListSummary_summary",
|
||||
instance, "mx_GenericEventListSummary_summary",
|
||||
);
|
||||
const summaryText = summary.textContent;
|
||||
|
Reference in New Issue
Block a user