2022-02-22 12:46:34 +01:00
// Jest Snapshot v1, https://goo.gl/fbAQLP
2022-05-03 02:26:37 +02:00
exports[`<TextualBody /> renders formatted m.text correctly linkification is not applied to code blocks 1`] = `
2022-12-29 17:21:00 +01:00
<span
class="mx_EventTile_body markdown-body"
dir="auto"
>
<p>
Visit
<code>
https://matrix.org/
</code>
</p>
<div
class="mx_EventTile_pre_container"
>
<pre
class="mx_EventTile_collapsedCodeBlock"
>
<span
class="mx_EventTile_lineNumbers"
>
<span>
1
</span>
</span>
<code>
https://matrix.org/
</code>
<span />
</pre>
<span
class="mx_EventTile_button mx_EventTile_copyButton "
/>
</div>
</span>
2022-05-03 02:26:37 +02:00
`;
2023-03-16 15:01:09 +01:00
exports[`<TextualBody /> renders formatted m.text correctly pills appear for an MXID permalink 1`] = `
<span
class="mx_EventTile_body markdown-body"
dir="auto"
>
Chat with
<span>
<bdi>
<a
2023-05-05 10:26:11 +02:00
aria-describedby="mx_Pill_0.123456"
2023-03-16 15:01:09 +01:00
class="mx_Pill mx_UserPill"
href="https://matrix.to/#/@user:example.com"
>
<img
alt=""
aria-hidden="true"
class="mx_BaseAvatar mx_BaseAvatar_image"
data-testid="avatar-img"
2023-05-11 20:29:48 +02:00
loading="lazy"
2023-03-16 15:01:09 +01:00
src="mxc://avatar.url/image.png"
style="width: 16px; height: 16px;"
/>
<span
2023-03-21 10:23:20 +01:00
class="mx_Pill_text"
2023-03-16 15:01:09 +01:00
>
Member
</span>
</a>
</bdi>
</span>
</span>
`;
2023-03-21 10:23:20 +01:00
exports[`<TextualBody /> renders formatted m.text correctly pills appear for event permalinks without a custom label 1`] = `
<DocumentFragment>
<div
class="mx_MTextBody mx_EventTile_content"
>
<span
class="mx_EventTile_body markdown-body"
dir="auto"
>
See this message
<span>
<bdi>
<a
2023-05-05 10:26:11 +02:00
aria-describedby="mx_Pill_0.123456"
2023-03-21 10:23:20 +01:00
class="mx_Pill mx_EventPill"
href="https://matrix.to/#/!ZxbRYPQXDXKGmDnJNg:example.com/$16085560162aNpaH:example.com?via=example.com"
>
<img
alt=""
aria-hidden="true"
class="mx_BaseAvatar mx_BaseAvatar_image"
data-testid="avatar-img"
2023-05-11 20:29:48 +02:00
loading="lazy"
2023-03-21 10:23:20 +01:00
src="mxc://avatar.url/room.png"
style="width: 16px; height: 16px;"
/>
<span
class="mx_Pill_text"
>
2023-03-22 13:27:24 +01:00
Message in room name
2023-03-21 10:23:20 +01:00
</span>
</a>
</bdi>
</span>
</span>
</div>
</DocumentFragment>
`;
exports[`<TextualBody /> renders formatted m.text correctly pills appear for room links with vias 1`] = `
<DocumentFragment>
<div
class="mx_MTextBody mx_EventTile_content"
>
<span
class="mx_EventTile_body markdown-body"
dir="auto"
>
A
<span>
<bdi>
<a
2023-05-05 10:26:11 +02:00
aria-describedby="mx_Pill_0.123456"
2023-03-21 10:23:20 +01:00
class="mx_Pill mx_RoomPill"
href="https://matrix.to/#/!ZxbRYPQXDXKGmDnJNg:example.com?via=example.com&via=bob.com"
>
<img
alt=""
aria-hidden="true"
class="mx_BaseAvatar mx_BaseAvatar_image"
data-testid="avatar-img"
2023-05-11 20:29:48 +02:00
loading="lazy"
2023-03-21 10:23:20 +01:00
src="mxc://avatar.url/room.png"
style="width: 16px; height: 16px;"
/>
<span
class="mx_Pill_text"
>
room name
</span>
</a>
</bdi>
</span>
with vias
</span>
</div>
</DocumentFragment>
`;
exports[`<TextualBody /> renders formatted m.text correctly pills do not appear for event permalinks with a custom label 1`] = `
<DocumentFragment>
<div
class="mx_MTextBody mx_EventTile_content"
>
<span
class="mx_EventTile_body markdown-body"
dir="auto"
>
An
<a
href="https://matrix.to/#/!ZxbRYPQXDXKGmDnJNg:example.com/$16085560162aNpaH:example.com?via=example.com"
rel="noreferrer noopener"
>
event link
</a>
with text
</span>
</div>
</DocumentFragment>
`;
2022-02-22 12:46:34 +01:00
exports[`<TextualBody /> renders formatted m.text correctly pills do not appear in code blocks 1`] = `
2022-12-29 17:21:00 +01:00
<span
class="mx_EventTile_body markdown-body"
dir="auto"
>
<p>
<code>
@room
</code>
</p>
<div
class="mx_EventTile_pre_container"
>
<pre
class="mx_EventTile_collapsedCodeBlock"
>
<span
class="mx_EventTile_lineNumbers"
>
<span>
1
</span>
</span>
<code>
@room
</code>
<span />
</pre>
<span
class="mx_EventTile_button mx_EventTile_copyButton "
/>
</div>
</span>
2022-02-22 12:46:34 +01:00
`;
2022-05-06 23:26:32 +02:00
2022-12-29 17:21:00 +01:00
exports[`<TextualBody /> renders formatted m.text correctly pills get injected correctly into the DOM 1`] = `
<span
class="mx_EventTile_body markdown-body"
dir="auto"
>
Hey
<span>
<bdi>
<a
2023-05-05 10:26:11 +02:00
aria-describedby="mx_Pill_0.123456"
2022-12-29 17:21:00 +01:00
class="mx_Pill mx_UserPill"
2023-03-08 13:06:50 +01:00
href="https://matrix.to/#/@user:server"
2022-12-29 17:21:00 +01:00
>
<img
alt=""
aria-hidden="true"
class="mx_BaseAvatar mx_BaseAvatar_image"
data-testid="avatar-img"
2023-05-11 20:29:48 +02:00
loading="lazy"
2022-12-29 17:21:00 +01:00
src="mxc://avatar.url/image.png"
style="width: 16px; height: 16px;"
/>
<span
2023-03-21 10:23:20 +01:00
class="mx_Pill_text"
2022-12-29 17:21:00 +01:00
>
Member
</span>
</a>
</bdi>
</span>
</span>
`;
2023-03-22 13:27:24 +01:00
exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to a message in the same room with the label »Message from Member« 1`] = `
"Visit
<span
><bdi
><a
class="mx_Pill mx_EventPill"
href="https://matrix.to/#/!room1:example.com/%event_id%"
2023-05-05 10:26:11 +02:00
aria-describedby="mx_Pill_0.123456"
2023-03-22 13:27:24 +01:00
><img
2023-05-11 20:29:48 +02:00
loading="lazy"
2023-03-22 13:27:24 +01:00
class="mx_BaseAvatar mx_BaseAvatar_image"
src="mxc://avatar.url/image.png"
style="width: 16px; height: 16px"
alt=""
data-testid="avatar-img"
aria-hidden="true"
/><span class="mx_Pill_text">Message from Member</span></a
></bdi
></span
>
"
`;
exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to an event in another room with the label »Message in Room 2« 1`] = `
"Visit
<span
><bdi
><a
class="mx_Pill mx_EventPill"
href="https://matrix.to/#/!room2:example.com/%event_id%"
2023-05-05 10:26:11 +02:00
aria-describedby="mx_Pill_0.123456"
2023-03-22 13:27:24 +01:00
><img
2023-05-11 20:29:48 +02:00
loading="lazy"
2023-03-22 13:27:24 +01:00
class="mx_BaseAvatar mx_BaseAvatar_image"
src="mxc://avatar.url/room.png"
style="width: 16px; height: 16px"
alt=""
data-testid="avatar-img"
aria-hidden="true"
/><span class="mx_Pill_text">Message in Room 2</span></a
></bdi
></span
>
"
`;
exports[`<TextualBody /> renders plain-text m.text correctly should pillify a permalink to an unknown message in the same room with the label »Message« 1`] = `
<span
class="mx_EventTile_body"
dir="auto"
>
Visit
<span>
<bdi>
<a
2023-05-05 10:26:11 +02:00
aria-describedby="mx_Pill_0.123456"
2023-03-22 13:27:24 +01:00
class="mx_Pill mx_EventPill"
href="https://matrix.to/#/!room1:example.com/!abc123"
>
<div
class="mx_Pill_LinkIcon mx_BaseAvatar mx_BaseAvatar_image"
/>
<span
class="mx_Pill_text"
>
Message
</span>
</a>
</bdi>
</span>
</span>
`;