тест
Some checks failed
CI / Lint (ruff + mypy) (push) Failing after 31s
CI / Run tests (push) Has been skipped
CI / Docker build test (push) Successful in 10s

This commit is contained in:
2026-04-02 21:51:01 +07:00
parent 75f5d4cea4
commit 8be26418b1
2 changed files with 54 additions and 1 deletions

View File

@@ -64,3 +64,32 @@ def test_build_channel_text_supports_per_actor_placeholders() -> None:
assert text.count("<b>ASTAT</b>") == 1
assert text.count("<b>MARI</b>") == 1
def test_build_channel_text_inlines_actor_fragment_without_duplication() -> None:
config = {
"template_text": (
'🌟 <a href="https://t.me/liebe"><b>LIEBE</b></a> she/her {{actor:liebe}}\n'
'🌟 <a href="https://t.me/victor"><b>VICTOR</b></a> tech bot'
),
"actors": [
{
"key": "liebe",
"display_name": "LIEBE",
"display_html": "<b>LIEBE</b>",
"link": "https://t.me/liebe",
"pronouns": "she/her",
"meta_html": " she/her ",
"emoji": "🌟",
"default_status": "backstage",
"phrases": {"backstage": "в закулисье."},
}
],
}
state = {"actors": {}}
text = build_channel_text(config, state)
assert text.count("<b>LIEBE</b>") == 1
assert "she/her в закулисье." in text
assert "в закулисье." in text