element-web/test/components/views/beacon/__snapshots__/RoomLiveShareWarning-test.tsx.snap
Kerry 752ad6a9f9
Live location sharing - refresh beacon expiry in room (#8116)
* add duration dropdown to live location picker

Signed-off-by: Kerry Archibald <kerrya@element.io>

* tidy comments

Signed-off-by: Kerry Archibald <kerrya@element.io>

* setup component

Signed-off-by: Kerry Archibald <kerrya@element.io>

* replace references to beaconInfoId with beacon.identifier

Signed-off-by: Kerry Archibald <kerrya@element.io>

* icon

Signed-off-by: Kerry Archibald <kerrya@element.io>

* component for styled live beacon icon

Signed-off-by: Kerry Archibald <kerrya@element.io>

* emit liveness change whenever livebeaconIds changes

Signed-off-by: Kerry Archibald <kerrya@element.io>

* Handle multiple live beacons in room share warning, test

Signed-off-by: Kerry Archibald <kerrya@element.io>

* un xdescribe beaconstore tests

Signed-off-by: Kerry Archibald <kerrya@element.io>

* missed copyrights

Signed-off-by: Kerry Archibald <kerrya@element.io>

* i18n

Signed-off-by: Kerry Archibald <kerrya@element.io>

* refresh beacon time remaining

Signed-off-by: Kerry Archibald <kerrya@element.io>

* kill timeout

Signed-off-by: Kerry Archibald <kerrya@element.io>

* use useInterval

Signed-off-by: Kerry Archibald <kerrya@element.io>

* beacon not optional in useMsRemaining

Signed-off-by: Kerry Archibald <kerrya@element.io>

* just use single "you are sharing" message

Signed-off-by: Kerry Archibald <kerrya@element.io>

* trigger

Signed-off-by: Kerry Archibald <kerrya@element.io>

* i18n

Signed-off-by: Kerry Archibald <kerrya@element.io>

* i18n again

Signed-off-by: Kerry Archibald <kerrya@element.io>
2022-03-23 11:12:58 +01:00

191 lines
5.3 KiB
Text

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<RoomLiveShareWarning /> when user has live beacons renders correctly with one live beacon in room 1`] = `
<RoomLiveShareWarning
roomId="$room1:server.org"
>
<div
className="mx_RoomLiveShareWarning"
>
<StyledLiveBeaconIcon
className="mx_RoomLiveShareWarning_icon"
>
<div
className="mx_StyledLiveBeaconIcon mx_RoomLiveShareWarning_icon"
/>
</StyledLiveBeaconIcon>
<span
className="mx_RoomLiveShareWarning_label"
>
You are sharing your live location
</span>
<LiveTimeRemaining
beacon={
Beacon {
"_beaconInfo": Object {
"assetType": "m.self",
"description": undefined,
"live": true,
"timeout": 3600000,
"timestamp": 1647270879403,
},
"_events": Object {
"Beacon.LivenessChange": Array [
[Function],
[Function],
],
"Beacon.new": [Function],
"Beacon.update": [Function],
},
"_eventsCount": 3,
"_isLive": true,
"_maxListeners": undefined,
"livenessWatchInterval": 1000000000002,
"roomId": "$room1:server.org",
"rootEvent": Object {
"content": Object {
"org.matrix.msc3488.asset": Object {
"type": "m.self",
},
"org.matrix.msc3488.ts": 1647270879403,
"org.matrix.msc3489.beacon_info": Object {
"description": undefined,
"live": true,
"timeout": 3600000,
},
},
"event_id": "$0",
"room_id": "$room1:server.org",
"state_key": "@alice:server.org",
"type": "org.matrix.msc3489.beacon_info.@alice:server.org.2",
},
Symbol(kCapture): false,
}
}
>
<span
className="mx_RoomLiveShareWarning_expiry"
data-test-id="room-live-share-expiry"
>
1h left
</span>
</LiveTimeRemaining>
<AccessibleButton
data-test-id="room-live-share-stop-sharing"
disabled={false}
element="button"
kind="danger"
onClick={[Function]}
role="button"
tabIndex={0}
>
<button
className="mx_AccessibleButton mx_AccessibleButton_hasKind mx_AccessibleButton_kind_danger"
data-test-id="room-live-share-stop-sharing"
onClick={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
role="button"
tabIndex={0}
>
Stop sharing
</button>
</AccessibleButton>
</div>
</RoomLiveShareWarning>
`;
exports[`<RoomLiveShareWarning /> when user has live beacons renders correctly with two live beacons in room 1`] = `
<RoomLiveShareWarning
roomId="$room2:server.org"
>
<div
className="mx_RoomLiveShareWarning"
>
<StyledLiveBeaconIcon
className="mx_RoomLiveShareWarning_icon"
>
<div
className="mx_StyledLiveBeaconIcon mx_RoomLiveShareWarning_icon"
/>
</StyledLiveBeaconIcon>
<span
className="mx_RoomLiveShareWarning_label"
>
You are sharing your live location
</span>
<LiveTimeRemaining
beacon={
Beacon {
"_beaconInfo": Object {
"assetType": "m.self",
"description": undefined,
"live": true,
"timeout": 43200000,
"timestamp": 1647270879403,
},
"_events": Object {
"Beacon.LivenessChange": Array [
[Function],
[Function],
],
"Beacon.new": [Function],
"Beacon.update": [Function],
},
"_eventsCount": 3,
"_isLive": true,
"_maxListeners": undefined,
"livenessWatchInterval": 1000000000010,
"roomId": "$room2:server.org",
"rootEvent": Object {
"content": Object {
"org.matrix.msc3488.asset": Object {
"type": "m.self",
},
"org.matrix.msc3488.ts": 1647270879403,
"org.matrix.msc3489.beacon_info": Object {
"description": undefined,
"live": true,
"timeout": 43200000,
},
},
"event_id": "$2",
"room_id": "$room2:server.org",
"state_key": "@alice:server.org",
"type": "org.matrix.msc3489.beacon_info.@alice:server.org.4",
},
Symbol(kCapture): false,
}
}
>
<span
className="mx_RoomLiveShareWarning_expiry"
data-test-id="room-live-share-expiry"
>
12h left
</span>
</LiveTimeRemaining>
<AccessibleButton
data-test-id="room-live-share-stop-sharing"
disabled={false}
element="button"
kind="danger"
onClick={[Function]}
role="button"
tabIndex={0}
>
<button
className="mx_AccessibleButton mx_AccessibleButton_hasKind mx_AccessibleButton_kind_danger"
data-test-id="room-live-share-stop-sharing"
onClick={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
role="button"
tabIndex={0}
>
Stop sharing
</button>
</AccessibleButton>
</div>
</RoomLiveShareWarning>
`;