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:
parent
3b1e715854
commit
c5633a24fe
2 changed files with 34 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue