Live location sharing - set replaces relation when stopping beacon (#8266)
* set replaces relation on stopping beacon Signed-off-by: Kerry Archibald <kerrya@element.io> * update tests for stopBeacon Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
parent
61076c3331
commit
44d446be89
2 changed files with 37 additions and 2 deletions
|
@ -20,6 +20,7 @@ import {
|
|||
BeaconEvent,
|
||||
getBeaconInfoIdentifier,
|
||||
MatrixEvent,
|
||||
RelationType,
|
||||
RoomStateEvent,
|
||||
RoomMember,
|
||||
} from "matrix-js-sdk/src/matrix";
|
||||
|
@ -472,6 +473,14 @@ describe('OwnBeaconStore', () => {
|
|||
const expectedUpdateContent = {
|
||||
...prevEventContent,
|
||||
live: false,
|
||||
["m.new_content"]: {
|
||||
...prevEventContent,
|
||||
live: false,
|
||||
},
|
||||
["m.relates_to"]: {
|
||||
event_id: alicesRoom1BeaconInfo.getId(),
|
||||
rel_type: RelationType.Replace,
|
||||
},
|
||||
};
|
||||
expect(mockClient.unstable_setLiveBeacon).toHaveBeenCalledWith(
|
||||
room1Id,
|
||||
|
@ -641,6 +650,14 @@ describe('OwnBeaconStore', () => {
|
|||
const expectedUpdateContent = {
|
||||
...prevEventContent,
|
||||
live: false,
|
||||
["m.new_content"]: {
|
||||
...prevEventContent,
|
||||
live: false,
|
||||
},
|
||||
["m.relates_to"]: {
|
||||
event_id: alicesRoom1BeaconInfo.getId(),
|
||||
rel_type: RelationType.Replace,
|
||||
},
|
||||
};
|
||||
expect(mockClient.unstable_setLiveBeacon).toHaveBeenCalledWith(
|
||||
room1Id,
|
||||
|
@ -666,6 +683,14 @@ describe('OwnBeaconStore', () => {
|
|||
const expectedUpdateContent = {
|
||||
...prevEventContent,
|
||||
live: false,
|
||||
["m.new_content"]: {
|
||||
...prevEventContent,
|
||||
live: false,
|
||||
},
|
||||
["m.relates_to"]: {
|
||||
event_id: alicesRoom1BeaconInfo.getId(),
|
||||
rel_type: RelationType.Replace,
|
||||
},
|
||||
};
|
||||
expect(mockClient.unstable_setLiveBeacon).toHaveBeenCalledWith(
|
||||
room1Id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue