Live location share - forward latest location (PSF-1044) (#8860)

* handle beacon location events in ForwardDialog

* add transformer for forwarded events in MessageContextMenu

* remove canForward

* update snapshots for beacon model change

* add comments

* fix bad copy pasted test

* add test for beacon locations
This commit is contained in:
Kerry 2022-06-17 15:27:08 +02:00 committed by GitHub
parent 0a90674e89
commit b51ef246ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 292 additions and 81 deletions

View file

@ -28,7 +28,6 @@ import {
canCancel,
canEditContent,
canEditOwnEvent,
canForward,
isContentActionable,
isLocationEvent,
isVoiceMessage,
@ -319,32 +318,6 @@ describe('EventUtils', () => {
});
});
describe('canForward()', () => {
it('returns true for a location event', () => {
const event = new MatrixEvent({
type: M_LOCATION.name,
});
expect(canForward(event)).toBe(true);
});
it('returns false for a poll event', () => {
const event = makePollStartEvent('Who?', userId);
expect(canForward(event)).toBe(false);
});
it('returns false for a beacon_info event', () => {
const event = makeBeaconInfoEvent(userId, roomId);
expect(canForward(event)).toBe(false);
});
it('returns true for a room message event', () => {
const event = new MatrixEvent({
type: EventType.RoomMessage,
content: {
body: 'Hello',
},
});
expect(canForward(event)).toBe(true);
});
});
describe('canCancel()', () => {
it.each([
[EventStatus.QUEUED],