"""Port of WESP test_zootech_k_hub_ui_contract for orchestrator public/wesp copy."""

from __future__ import annotations

from pathlib import Path

PROJECT_ROOT = Path(__file__).resolve().parents[2] / "web" / "public" / "static"

ZOOTECH_PAGES = (
    "recipes.html",
    "reports.html",
    "components.html",
    "feed_dispensers.html",
    "consumption.html",
)


def test_zootech_pages_include_k_hub_assets():
    for page in ZOOTECH_PAGES:
        html = (PROJECT_ROOT / page).read_text(encoding="utf-8")
        assert "wesp-zootech-k-hub.css" in html, page
        assert "daily-plan-panel.js" in html, page
        assert "wesp-zootech-notification-center.js" in html, page


def test_orchestrator_boot_present():
    boot = (PROJECT_ROOT / "js" / "wesp-orchestrator-boot.js").read_text(encoding="utf-8")
    assert "WespOrchestratorBoot" in boot
    assert "enterprise_id" in boot


def test_multiserver_panel_uses_sync_api():
    js = (PROJECT_ROOT / "js" / "pages" / "multiserver-panel.js").read_text(encoding="utf-8")
    assert "/api/v1/sync/conflicts" in js
    assert "resolve" in js
