You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-06 10:22:45 +03:00
Live location sharing: don't group beacon info with room creation summary (#8468)
* dont group beacon info with room creation summary Signed-off-by: Kerry Archibald <kerrya@element.io> * remove debugs Signed-off-by: Kerry Archibald <kerrya@element.io> * add comment Signed-off-by: Kerry Archibald <kerrya@element.io> * update comment Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
@@ -34,6 +34,11 @@ import * as TestUtilsMatrix from "../../test-utils";
|
||||
import EventListSummary from "../../../src/components/views/elements/EventListSummary";
|
||||
import GenericEventListSummary from "../../../src/components/views/elements/GenericEventListSummary";
|
||||
import DateSeparator from "../../../src/components/views/messages/DateSeparator";
|
||||
import { makeBeaconInfoEvent } from '../../test-utils';
|
||||
|
||||
jest.mock('../../../src/utils/beacon', () => ({
|
||||
useBeacon: jest.fn(),
|
||||
}));
|
||||
|
||||
let client;
|
||||
const room = new Matrix.Room("!roomId:server_name");
|
||||
@@ -481,6 +486,27 @@ describe('MessagePanel', function() {
|
||||
expect(summaryEventTiles.length).toEqual(tiles.length - 3);
|
||||
});
|
||||
|
||||
it('should not collapse beacons as part of creation events', function() {
|
||||
const [creationEvent] = mkCreationEvents();
|
||||
const beaconInfoEvent = makeBeaconInfoEvent(
|
||||
creationEvent.getSender(),
|
||||
creationEvent.getRoomId(),
|
||||
{ isLive: true },
|
||||
);
|
||||
const combinedEvents = [creationEvent, beaconInfoEvent];
|
||||
TestUtilsMatrix.upsertRoomStateEvents(room, combinedEvents);
|
||||
const res = mount(
|
||||
<WrappedMessagePanel className="cls" events={combinedEvents} />,
|
||||
);
|
||||
|
||||
const summaryTiles = res.find(GenericEventListSummary);
|
||||
const summaryTile = summaryTiles.at(0);
|
||||
|
||||
const summaryEventTiles = summaryTile.find(UnwrappedEventTile);
|
||||
// nothing in the summary
|
||||
expect(summaryEventTiles.length).toEqual(0);
|
||||
});
|
||||
|
||||
it('should hide read-marker at the end of creation event summary', function() {
|
||||
const events = mkCreationEvents();
|
||||
TestUtilsMatrix.upsertRoomStateEvents(room, events);
|
||||
|
Reference in New Issue
Block a user