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:
parent
0a90674e89
commit
b51ef246ab
12 changed files with 292 additions and 81 deletions
|
@ -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],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue