Ajoute le widget de chat Chatwoot (essai) — issue #120
Injecte le script d'intégration Chatwoot dans app.index_string, activé via CHATWOOT_WEBSITE_TOKEN. Vide par défaut, donc désactivé en test/CI.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
from src.utils.chatwoot import build_widget_script
|
||||
|
||||
|
||||
def test_no_token_returns_empty_string():
|
||||
assert build_widget_script(None) == ""
|
||||
|
||||
|
||||
def test_empty_token_returns_empty_string():
|
||||
assert build_widget_script("") == ""
|
||||
|
||||
|
||||
def test_token_produces_script_with_token_and_managed_base_url():
|
||||
script = build_widget_script("PVejdJRyKtSZdEkJtDJQ3xCd")
|
||||
assert "<script>" in script
|
||||
assert "websiteToken: 'PVejdJRyKtSZdEkJtDJQ3xCd'" in script
|
||||
assert "baseUrl: BASE_URL" in script
|
||||
assert 'BASE_URL="https://app.chatwoot.com"' in script
|
||||
Reference in New Issue
Block a user