ObsiGate 2.83.3 : barre v0.3.0, liens Hub du menu compte (tests)
This commit is contained in:
@@ -78,6 +78,29 @@ def test_barre_v020_onglet_shaarit_et_garde_data_theme():
|
|||||||
assert 'shaarit: "https://shaarit-dev.dracodev.net/"' in js
|
assert 'shaarit: "https://shaarit-dev.dracodev.net/"' in js
|
||||||
|
|
||||||
|
|
||||||
|
def test_barre_v030_liens_hub_menu_compte():
|
||||||
|
# Barre v0.3.0 (dracodev-commons, HUB-1 / fusion #115) : clé
|
||||||
|
# urls.hub (défaut officiel + dérivation hub-dev), liens du menu
|
||||||
|
# compte (Télécharger, À Propos, Aides, Profil-lien) construits
|
||||||
|
# par le JS vendangé, et branchement hôte : index.html passe la
|
||||||
|
# base Hub de window.DRACO_URLS (backend/draco_config) en
|
||||||
|
# urls.hub de DRACO_BAR_CONFIG.
|
||||||
|
js = (FRONTEND / "draco-barre.js").read_text(encoding="utf-8")
|
||||||
|
assert 'hub: "https://hub.dracodev.net/"' in js
|
||||||
|
assert 'hub: "https://hub-dev.dracodev.net/"' in js
|
||||||
|
assert '"telecharger", "Télécharger"' in js
|
||||||
|
assert '"a-propos", "À Propos"' in js
|
||||||
|
assert '"aide", "Aides"' in js
|
||||||
|
assert '"profil", "Profil"' in js
|
||||||
|
assert 'data-hub-link' in js
|
||||||
|
# Profil n'est plus un item relayé ; Déconnexion le reste.
|
||||||
|
assert 'data-compte-act", "profil"' not in js
|
||||||
|
assert 'data-compte-act", "deconnexion"' in js
|
||||||
|
html = _index()
|
||||||
|
assert "window.DRACO_URLS.hub" in html
|
||||||
|
assert "v0.3.0" in html
|
||||||
|
|
||||||
|
|
||||||
def test_panneau_spark_integre_218():
|
def test_panneau_spark_integre_218():
|
||||||
# #218 : le bouton Spark de la barre ouvre le panneau de l'agent
|
# #218 : le bouton Spark de la barre ouvre le panneau de l'agent
|
||||||
# commun (mêmes assets partagés que TikTak / Flowdeck / Kanbante).
|
# commun (mêmes assets partagés que TikTak / Flowdeck / Kanbante).
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ def env_propre(monkeypatch):
|
|||||||
for nom in (
|
for nom in (
|
||||||
"DRACO_AGENT_URL", "DRACO_OBSIGATE_URL", "DRACO_FLOWDECK_URL",
|
"DRACO_AGENT_URL", "DRACO_OBSIGATE_URL", "DRACO_FLOWDECK_URL",
|
||||||
"DRACO_TIKTAK_URL", "DRACO_KANBANTE_URL", "DRACO_SHAARIT_URL",
|
"DRACO_TIKTAK_URL", "DRACO_KANBANTE_URL", "DRACO_SHAARIT_URL",
|
||||||
|
"DRACO_HUB_URL",
|
||||||
"DRACO_GITEA_URL",
|
"DRACO_GITEA_URL",
|
||||||
"AGENT_EVENEMENTS_URL",
|
"AGENT_EVENEMENTS_URL",
|
||||||
):
|
):
|
||||||
@@ -52,6 +53,22 @@ def test_shaarit_defaut_et_derivation(env_propre):
|
|||||||
assert draco_config.app_url("shaarit") == "https://bm.example.net"
|
assert draco_config.app_url("shaarit") == "https://bm.example.net"
|
||||||
|
|
||||||
|
|
||||||
|
def test_hub_defaut_et_derivation(env_propre):
|
||||||
|
"""Barre v0.3.0 (HUB-1) : le Hub suit le même mécanisme que les
|
||||||
|
autres sœurs — défaut officiel, dérivation -dev depuis l'hôte
|
||||||
|
de l'agent, variable explicite prioritaire ; il est servi dans
|
||||||
|
urls_publiques() (window.DRACO_URLS) pour les liens du menu
|
||||||
|
compte, sans onglet dans la barre."""
|
||||||
|
assert draco_config.app_url("hub") == "https://hub.dracodev.net"
|
||||||
|
env_propre.setenv(
|
||||||
|
"AGENT_EVENEMENTS_URL", "https://agent-dev.dracodev.net/api/v1/evenements")
|
||||||
|
assert draco_config.app_url("hub") == "https://hub-dev.dracodev.net"
|
||||||
|
assert draco_config.urls_publiques()["hub"] == \
|
||||||
|
"https://hub-dev.dracodev.net"
|
||||||
|
env_propre.setenv("DRACO_HUB_URL", "https://hub.example.net/")
|
||||||
|
assert draco_config.app_url("hub") == "https://hub.example.net"
|
||||||
|
|
||||||
|
|
||||||
def test_agent_derive_des_evenements(env_propre):
|
def test_agent_derive_des_evenements(env_propre):
|
||||||
"""Sans DRACO_AGENT_URL, l'origine suit AGENT_EVENEMENTS_URL —
|
"""Sans DRACO_AGENT_URL, l'origine suit AGENT_EVENEMENTS_URL —
|
||||||
la configuration réelle du poste (dev inclus)."""
|
la configuration réelle du poste (dev inclus)."""
|
||||||
|
|||||||
Reference in New Issue
Block a user