fix: allow help navigation outside help mode

This commit is contained in:
hermes committed 2026-10-12 20:40:59 +02:00
1 parent a11b5aac64
commit aba1eb4ced
3 files changed
+9 -8

No files matched your search

+8 -4
View File
@@ -298,7 +298,7 @@ class OnboardingTests(unittest.IsolatedAsyncioTestCase):
edit.assert_not_awaited()
async def test_help_callback_is_rejected_outside_help_mode(self):
async def test_help_callback_edits_message_outside_help_mode(self):
message = Message(
message_id=79,
date=datetime.now(),
@@ -306,11 +306,15 @@ class OnboardingTests(unittest.IsolatedAsyncioTestCase):
)
callback = self._callback("help:posts", message)
with patch.object(bot, "edit_rich_message", new=AsyncMock()) as edit:
with patch.object(bot, "edit_rich_message", new=AsyncMock(return_value=True)) as edit:
await bot.help_navigation(callback, _StubState("lobby"))
edit.assert_not_awaited()
callback.answer.assert_awaited_once_with("Сначала открой режим /help.", show_alert=True)
edit.assert_awaited_once_with(
message,
bot.help_view("posts"),
reply_markup=bot.help_inline_keyboard(),
)
callback.answer.assert_awaited_once_with()
def test_welcome_message_has_examples_and_help_handoff(self):
from help_message import WELCOME_RICH_HTML, rich_to_plain