2022-03-11 16:52:57 +08:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
|
|
|
exports[`MLocationBody <MLocationBody> with error displays correct fallback content when map_style_url is misconfigured 1`] = `
|
|
|
|
<div
|
2022-05-03 19:51:50 +08:00
|
|
|
className="mx_EventTile_body mx_MLocationBody"
|
2022-03-11 16:52:57 +08:00
|
|
|
>
|
|
|
|
<span
|
|
|
|
className="mx_EventTile_tileError"
|
|
|
|
>
|
|
|
|
Unable to load map: This homeserver is not configured correctly to display maps, or the configured map server may be unreachable.
|
|
|
|
</span>
|
|
|
|
<br />
|
|
|
|
Shared a location: Found at geo:51.5076,-0.1276 at 2021-12-21T12:22+0000
|
|
|
|
</div>
|
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`MLocationBody <MLocationBody> with error displays correct fallback content without error style when map_style_url is not configured 1`] = `
|
|
|
|
<div
|
2022-05-03 19:51:50 +08:00
|
|
|
className="mx_EventTile_body mx_MLocationBody"
|
2022-03-11 16:52:57 +08:00
|
|
|
>
|
|
|
|
<span
|
|
|
|
className=""
|
|
|
|
>
|
|
|
|
Unable to load map: This homeserver is not configured to display maps.
|
|
|
|
</span>
|
|
|
|
<br />
|
|
|
|
Shared a location: Found at geo:51.5076,-0.1276 at 2021-12-21T12:22+0000
|
|
|
|
</div>
|
|
|
|
`;
|
2022-04-12 00:40:06 +08:00
|
|
|
|
|
|
|
exports[`MLocationBody <MLocationBody> without error renders map correctly 1`] = `
|
|
|
|
<MLocationBody
|
|
|
|
highlightLink=""
|
2022-11-04 18:48:08 +08:00
|
|
|
highlights={[]}
|
|
|
|
mediaEventHelper={{}}
|
2022-04-12 00:40:06 +08:00
|
|
|
mxEvent={
|
2022-11-04 18:48:08 +08:00
|
|
|
{
|
|
|
|
"content": {
|
2022-04-12 00:40:06 +08:00
|
|
|
"body": "Found at geo:51.5076,-0.1276 at 2021-12-21T12:22+0000",
|
|
|
|
"geo_uri": "geo:51.5076,-0.1276",
|
|
|
|
"msgtype": "m.location",
|
|
|
|
"org.matrix.msc1767.text": "Found at geo:51.5076,-0.1276 at 2021-12-21T12:22+0000",
|
2022-11-04 18:48:08 +08:00
|
|
|
"org.matrix.msc3488.asset": {
|
2022-04-12 00:40:06 +08:00
|
|
|
"type": "m.pin",
|
|
|
|
},
|
2022-11-04 18:48:08 +08:00
|
|
|
"org.matrix.msc3488.location": {
|
2022-04-12 00:40:06 +08:00
|
|
|
"description": "Human-readable label",
|
|
|
|
"uri": "geo:51.5076,-0.1276",
|
|
|
|
},
|
|
|
|
"org.matrix.msc3488.ts": 252523,
|
|
|
|
},
|
|
|
|
"event_id": "$2",
|
|
|
|
"type": "org.matrix.msc3488.location",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onHeightChanged={[MockFunction]}
|
|
|
|
onMessageAllowed={[MockFunction]}
|
2022-11-04 18:48:08 +08:00
|
|
|
permalinkCreator={{}}
|
2022-04-12 00:40:06 +08:00
|
|
|
>
|
|
|
|
<LocationBodyContent
|
2022-05-24 16:05:11 +08:00
|
|
|
mapId="mx_MLocationBody_$2_HHHHHHHH"
|
2022-04-12 00:40:06 +08:00
|
|
|
mxEvent={
|
2022-11-04 18:48:08 +08:00
|
|
|
{
|
|
|
|
"content": {
|
2022-04-12 00:40:06 +08:00
|
|
|
"body": "Found at geo:51.5076,-0.1276 at 2021-12-21T12:22+0000",
|
|
|
|
"geo_uri": "geo:51.5076,-0.1276",
|
|
|
|
"msgtype": "m.location",
|
|
|
|
"org.matrix.msc1767.text": "Found at geo:51.5076,-0.1276 at 2021-12-21T12:22+0000",
|
2022-11-04 18:48:08 +08:00
|
|
|
"org.matrix.msc3488.asset": {
|
2022-04-12 00:40:06 +08:00
|
|
|
"type": "m.pin",
|
|
|
|
},
|
2022-11-04 18:48:08 +08:00
|
|
|
"org.matrix.msc3488.location": {
|
2022-04-12 00:40:06 +08:00
|
|
|
"description": "Human-readable label",
|
|
|
|
"uri": "geo:51.5076,-0.1276",
|
|
|
|
},
|
|
|
|
"org.matrix.msc3488.ts": 252523,
|
|
|
|
},
|
|
|
|
"event_id": "$2",
|
|
|
|
"type": "org.matrix.msc3488.location",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onClick={[Function]}
|
|
|
|
onError={[Function]}
|
|
|
|
tooltip="Expand map"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
className="mx_MLocationBody"
|
|
|
|
>
|
|
|
|
<TooltipTarget
|
|
|
|
alignment={5}
|
|
|
|
label="Expand map"
|
|
|
|
maxParentWidth={450}
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
onBlur={[Function]}
|
|
|
|
onFocus={[Function]}
|
|
|
|
onMouseLeave={[Function]}
|
2022-05-16 20:10:00 +08:00
|
|
|
onMouseMove={[Function]}
|
2022-04-12 00:40:06 +08:00
|
|
|
onMouseOver={[Function]}
|
|
|
|
tabIndex={0}
|
|
|
|
>
|
|
|
|
<Map
|
|
|
|
centerGeoUri="geo:51.5076,-0.1276"
|
|
|
|
className="mx_MLocationBody_map"
|
2022-05-24 16:05:11 +08:00
|
|
|
id="mx_MLocationBody_$2_HHHHHHHH"
|
2022-04-12 00:40:06 +08:00
|
|
|
onClick={[Function]}
|
|
|
|
onError={[Function]}
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
className="mx_Map mx_MLocationBody_map"
|
2022-05-24 16:05:11 +08:00
|
|
|
id="mx_Map_mx_MLocationBody_$2_HHHHHHHH"
|
2022-04-12 00:40:06 +08:00
|
|
|
onClick={[Function]}
|
|
|
|
>
|
|
|
|
<SmartMarker
|
|
|
|
geoUri="geo:51.5076,-0.1276"
|
2022-05-24 16:05:11 +08:00
|
|
|
id="mx_MLocationBody_$2_HHHHHHHH-marker"
|
2022-04-12 00:40:06 +08:00
|
|
|
map={
|
|
|
|
MockMap {
|
2022-11-04 18:48:08 +08:00
|
|
|
"_events": {
|
|
|
|
"error": [
|
2022-04-12 00:40:06 +08:00
|
|
|
[Function],
|
|
|
|
[Function],
|
2022-06-15 22:38:35 +08:00
|
|
|
[Function],
|
|
|
|
[Function],
|
|
|
|
[Function],
|
|
|
|
[Function],
|
2022-04-12 00:40:06 +08:00
|
|
|
],
|
|
|
|
},
|
|
|
|
"_eventsCount": 1,
|
|
|
|
"_maxListeners": undefined,
|
2022-05-23 18:19:59 +08:00
|
|
|
"addControl": [MockFunction] {
|
2022-11-04 18:48:08 +08:00
|
|
|
"calls": [
|
|
|
|
[
|
2022-05-23 18:19:59 +08:00
|
|
|
mockConstructor {},
|
|
|
|
"top-right",
|
|
|
|
],
|
2022-11-04 18:48:08 +08:00
|
|
|
[
|
2022-06-15 22:38:35 +08:00
|
|
|
mockConstructor {},
|
|
|
|
"top-right",
|
|
|
|
],
|
2022-05-23 18:19:59 +08:00
|
|
|
],
|
2022-11-04 18:48:08 +08:00
|
|
|
"results": [
|
|
|
|
{
|
2022-05-23 18:19:59 +08:00
|
|
|
"type": "return",
|
|
|
|
"value": undefined,
|
|
|
|
},
|
2022-11-04 18:48:08 +08:00
|
|
|
{
|
2022-06-15 22:38:35 +08:00
|
|
|
"type": "return",
|
|
|
|
"value": undefined,
|
|
|
|
},
|
2022-05-23 18:19:59 +08:00
|
|
|
],
|
|
|
|
},
|
2022-04-19 19:35:39 +08:00
|
|
|
"fitBounds": [MockFunction],
|
2022-04-12 00:40:06 +08:00
|
|
|
"removeControl": [MockFunction],
|
|
|
|
"setCenter": [MockFunction] {
|
2022-11-04 18:48:08 +08:00
|
|
|
"calls": [
|
|
|
|
[
|
|
|
|
{
|
2022-04-12 00:40:06 +08:00
|
|
|
"lat": 51.5076,
|
|
|
|
"lon": -0.1276,
|
|
|
|
},
|
|
|
|
],
|
2022-11-04 18:48:08 +08:00
|
|
|
[
|
|
|
|
{
|
2022-06-15 22:38:35 +08:00
|
|
|
"lat": 51.5076,
|
|
|
|
"lon": -0.1276,
|
|
|
|
},
|
|
|
|
],
|
2022-04-12 00:40:06 +08:00
|
|
|
],
|
2022-11-04 18:48:08 +08:00
|
|
|
"results": [
|
|
|
|
{
|
2022-04-12 00:40:06 +08:00
|
|
|
"type": "return",
|
|
|
|
"value": undefined,
|
|
|
|
},
|
2022-11-04 18:48:08 +08:00
|
|
|
{
|
2022-06-15 22:38:35 +08:00
|
|
|
"type": "return",
|
|
|
|
"value": undefined,
|
|
|
|
},
|
2022-04-12 00:40:06 +08:00
|
|
|
],
|
|
|
|
},
|
|
|
|
"setStyle": [MockFunction],
|
|
|
|
"zoomIn": [MockFunction],
|
|
|
|
"zoomOut": [MockFunction],
|
|
|
|
Symbol(kCapture): false,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
>
|
2022-04-14 21:14:05 +08:00
|
|
|
<span>
|
|
|
|
<ForwardRef
|
2022-05-24 16:05:11 +08:00
|
|
|
id="mx_MLocationBody_$2_HHHHHHHH-marker"
|
2022-04-12 00:40:06 +08:00
|
|
|
>
|
|
|
|
<div
|
2022-04-14 21:14:05 +08:00
|
|
|
className="mx_Marker mx_Marker_defaultColor"
|
2022-05-24 16:05:11 +08:00
|
|
|
id="mx_MLocationBody_$2_HHHHHHHH-marker"
|
2022-04-12 00:40:06 +08:00
|
|
|
>
|
2022-05-13 16:30:53 +08:00
|
|
|
<OptionalTooltip>
|
2022-04-14 21:14:05 +08:00
|
|
|
<div
|
2022-05-13 16:30:53 +08:00
|
|
|
className="mx_Marker_border"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
className="mx_Marker_icon"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</OptionalTooltip>
|
2022-04-12 00:40:06 +08:00
|
|
|
</div>
|
2022-04-14 21:14:05 +08:00
|
|
|
</ForwardRef>
|
|
|
|
</span>
|
2022-04-12 00:40:06 +08:00
|
|
|
</SmartMarker>
|
|
|
|
</div>
|
|
|
|
</Map>
|
|
|
|
</div>
|
|
|
|
</TooltipTarget>
|
|
|
|
</div>
|
|
|
|
</LocationBodyContent>
|
|
|
|
</MLocationBody>
|
|
|
|
`;
|