Add operator unified messenger MVP

This commit is contained in:
Yera All
2026-04-16 22:16:57 +05:00
parent 1206ff91ac
commit 3b5a7ad2e7
4 changed files with 1225 additions and 12 deletions
+37 -4
View File
@@ -155,7 +155,8 @@ def test_operator_ui_contains_unified_inbox_panel():
assert "function openUnifiedInboxItem(button)" in app_js
assert "function handleUnifiedInboxClick(event)" in app_js
assert "function refreshUnifiedInbox()" in app_js
assert "window.location.hash = '#telegram-page';" in app_js
assert "window.location.hash = '#messages';" in app_js
assert "await selectMessengerConversation(messengerConversationId('telegram', threadId));" in app_js
assert "window.location.hash = '#calls';" in app_js
assert "window.location.hash = '#interactions';" in app_js
@@ -210,7 +211,8 @@ def test_operator_ui_contains_telegram_workspace_page():
index_html = (Path(__file__).resolve().parents[1] / "ui" / "operator" / "index.html").read_text(encoding="utf-8")
assert 'id="telegramView"' in index_html
assert 'data-operator-view="telegram"' in index_html
assert 'data-operator-view-link="telegram"' in index_html
assert 'data-operator-view-link="telegram"' not in index_html
assert 'data-debug-channel="telegram"' in index_html
assert 'href="#telegram-page"' in index_html
assert 'id="loadTelegramThreadsBtn"' in index_html
assert 'id="telegramThreadsList"' in index_html
@@ -235,6 +237,37 @@ def test_operator_ui_contains_telegram_workspace_page():
assert "function sendTelegramReply" in app_js
def test_operator_ui_contains_unified_messenger_mvp():
app_js = (Path(__file__).resolve().parents[1] / "ui" / "operator" / "app.js").read_text(encoding="utf-8")
index_html = (Path(__file__).resolve().parents[1] / "ui" / "operator" / "index.html").read_text(encoding="utf-8")
assert 'data-operator-view-link="messages"' in index_html
assert 'href="#messages"' in index_html
assert 'id="messagesView"' in index_html
assert 'data-operator-view="messages"' in index_html
assert 'id="messengerConversationList"' in index_html
assert 'id="messengerMessagesTimeline"' in index_html
assert 'id="messengerReplyText"' in index_html
assert 'id="messengerSendReplyBtn"' in index_html
assert 'id="messengerClaimBtn"' in index_html
assert 'id="messengerCloseBtn"' in index_html
assert 'id="messengerOpenProfileBtn"' in index_html
assert 'id="messengerContextAiSummary"' in index_html
assert 'Telegram' in index_html
assert "messenger: {" in app_js
assert "function messengerConversationFromTelegramThread(thread)" in app_js
assert "function buildMessengerConversations()" in app_js
assert "function renderMessengerWorkspace()" in app_js
assert "function claimMessengerConversation()" in app_js
assert "function sendMessengerReply()" in app_js
assert "function closeMessengerConversation()" in app_js
assert "api('telegram', 'integrations/telegram/threads')" in app_js
assert "integrations/telegram/threads/${encodeURIComponent(conversation.thread_id)}/messages" in app_js
assert "integrations/telegram/threads/${encodeURIComponent(conversation.thread_id)}/claim" in app_js
assert "integrations/telegram/threads/${encodeURIComponent(conversation.thread_id)}/close" in app_js
assert "setInterval(() => {" in app_js
assert "}, 5000);" in app_js
def test_operator_ui_contains_live_call_control_block():
app_js = (Path(__file__).resolve().parents[1] / "ui" / "operator" / "app.js").read_text(encoding="utf-8")
index_html = (Path(__file__).resolve().parents[1] / "ui" / "operator" / "index.html").read_text(encoding="utf-8")
@@ -355,8 +388,8 @@ def test_operator_ui_surfaces_voice_name_state_across_call_views():
assert ".micro-badge.name-confirmed {" in styles_css
assert ".micro-badge.name-followup {" in styles_css
assert ".micro-badge.name-missing {" in styles_css
assert "/operator/assets/styles.css?v=track23-customer-profile-name-meta1" in index_html
assert "/operator/assets/app.js?v=track42-customer-profile-name-meta1" in index_html
assert "/operator/assets/styles.css?v=track24-messenger-mvp1" in index_html
assert "/operator/assets/app.js?v=track43-messenger-mvp1" in index_html
def test_operator_ui_hides_whatsapp_behind_feature_flag():