Flowdeck 7.84.13 : tests Hub (résolution draco_urls, marqueurs barre v0.3.0)
This commit is contained in:
@@ -53,6 +53,25 @@ 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 (commons, HUB-1 / fusion #115) : JS vendangé avec
|
||||||
|
la clé hub (défaut + dérivation hub-dev) et les liens du menu
|
||||||
|
compte ; le gabarit passe draco_urls().hub en urls.hub."""
|
||||||
|
js = (ROOT / "static/js/vendor/draco-barre.js").read_text()
|
||||||
|
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
|
||||||
|
assert 'data-compte-act", "profil"' not in js
|
||||||
|
assert 'data-compte-act", "deconnexion"' in js
|
||||||
|
gabarit = (ROOT / "app/templates/_draco_bar.html").read_text()
|
||||||
|
rendu = _hors_commentaires(gabarit)
|
||||||
|
assert 'urls: { hub: "{{ draco_urls().hub }}/" }' in rendu
|
||||||
|
|
||||||
|
|
||||||
def test_barre_intacte_apres_suppression():
|
def test_barre_intacte_apres_suppression():
|
||||||
"""Le 5e onglet Console Spark et la marque survivent a la suppression."""
|
"""Le 5e onglet Console Spark et la marque survivent a la suppression."""
|
||||||
gabarit = (ROOT / "app/templates/_draco_bar.html").read_text()
|
gabarit = (ROOT / "app/templates/_draco_bar.html").read_text()
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import pytest
|
|||||||
from app.services import draco_urls
|
from app.services import draco_urls
|
||||||
|
|
||||||
VARS = ("DRACO_SSO_URL", "DRACO_AGENT_URL", "TIKTAK_URL", "KANBANTE_URL",
|
VARS = ("DRACO_SSO_URL", "DRACO_AGENT_URL", "TIKTAK_URL", "KANBANTE_URL",
|
||||||
"SHAARIT_URL", "FLOWDECK_URL", "OAUTH_REDIRECT_URI",
|
"SHAARIT_URL", "HUB_URL", "FLOWDECK_URL", "OAUTH_REDIRECT_URI",
|
||||||
"AGENT_EVENEMENTS_URL")
|
"AGENT_EVENEMENTS_URL")
|
||||||
|
|
||||||
|
|
||||||
@@ -63,6 +63,24 @@ def test_shaarit_defaut_derivation_et_explicite(monkeypatch, avec_hote):
|
|||||||
assert draco_urls.shaarit_url() == "https://bm.example.net"
|
assert draco_urls.shaarit_url() == "https://bm.example.net"
|
||||||
|
|
||||||
|
|
||||||
|
def test_hub_defaut_derivation_et_explicite(monkeypatch, avec_hote):
|
||||||
|
# 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 (agent connu
|
||||||
|
# puis hôte de la requête), explicite prioritaire. Pas d'onglet :
|
||||||
|
# sa base sert les liens du menu compte via urls.hub.
|
||||||
|
assert draco_urls.hub_url() == "https://hub.dracodev.net"
|
||||||
|
assert draco_urls.toutes()["hub"] == "https://hub.dracodev.net"
|
||||||
|
monkeypatch.setenv(
|
||||||
|
"AGENT_EVENEMENTS_URL",
|
||||||
|
"https://agent-dev.dracodev.net/api/v1/evenements")
|
||||||
|
assert draco_urls.hub_url() == "https://hub-dev.dracodev.net"
|
||||||
|
monkeypatch.delenv("AGENT_EVENEMENTS_URL")
|
||||||
|
avec_hote("flowdeck-dev.dracodev.net")
|
||||||
|
assert draco_urls.hub_url() == "https://hub-dev.dracodev.net"
|
||||||
|
monkeypatch.setenv("HUB_URL", "https://hub.example.net/")
|
||||||
|
assert draco_urls.hub_url() == "https://hub.example.net"
|
||||||
|
|
||||||
|
|
||||||
def test_flowdeck_url_derivée_oauth_redirect(monkeypatch):
|
def test_flowdeck_url_derivée_oauth_redirect(monkeypatch):
|
||||||
monkeypatch.setenv(
|
monkeypatch.setenv(
|
||||||
"OAUTH_REDIRECT_URI", "https://flowdeck-dev.dracodev.net/auth/callback")
|
"OAUTH_REDIRECT_URI", "https://flowdeck-dev.dracodev.net/auth/callback")
|
||||||
|
|||||||
Reference in New Issue
Block a user