42авфаыв
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from session_bot.render import build_channel_text
|
||||
from session_bot.html_entities import html_to_text_entities
|
||||
|
||||
|
||||
def test_build_channel_text_includes_phrase() -> None:
|
||||
@@ -111,3 +112,13 @@ def test_plain_links_are_converted_to_html() -> None:
|
||||
text = build_channel_text(config, {"actors": {}})
|
||||
|
||||
assert '<a href="https://example.com">rules</a>' in text
|
||||
|
||||
|
||||
def test_html_to_text_entities_supports_custom_emoji_and_links() -> None:
|
||||
text, entities = html_to_text_entities(
|
||||
'<tg-emoji emoji-id="123">🌟</tg-emoji> <a href="https://example.com">rules</a>'
|
||||
)
|
||||
|
||||
assert text == "🌟 rules"
|
||||
assert any(entity.type == "custom_emoji" and entity.custom_emoji_id == "123" for entity in entities)
|
||||
assert any(entity.type == "text_link" and entity.url == "https://example.com" for entity in entities)
|
||||
|
||||
Reference in New Issue
Block a user