Files
xenia-pos-local/local_backend/tests/test_module_texts.py
T
bonaminandClaude Opus 5.5 0d0b2d78e1 feat(manager): Apps, Integrations and License pages on the module catalogue
Platform-v2 step 2.6c:
- Apps (device apps, features, always-included core) and Integrations: module
  cards from GET /api/platform/modules with state (on / off / waiting for a
  dependency / not in your license / always on), dependencies, limits and an
  Open button where the manager has a page; core.modules.manage toggles them
  (PUT /api/platform/modules/{key}), with a confirm listing the modules that
  stop too; bootstrap reloads so the sidebar follows at once
- License page: licensed / free (with the reason) / development, site id,
  validity, last contact, "check the license now" (POST /api/system/sync-license),
  every module's entitlement and limits
- i18n: new `modules` namespace (names, descriptions, limit labels, en + el)
  kept complete against the registry by local_backend/tests/test_module_texts.py
- nav: Integrations and License in the sidebar; old AppsPage removed
- e2e manager.mjs: 43 checks (+ card states, toggle from the card, dependency
  warning, integrations, license page)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 22:33:54 +02:00

27 lines
997 B
Python

"""Every module (and each of its limits) has a name and description for staff in every
UI language (packages/i18n/locales/<lang>/modules.json, plan step 2.6c). A new module in
a manifest fails here until its texts exist."""
import json
from pathlib import Path
import pytest
from core.modules.registry import registry
LOCALES = Path(__file__).resolve().parents[2] / "packages" / "i18n" / "locales"
@pytest.mark.parametrize("lang", ["en", "el"])
def test_every_module_has_texts(lang):
texts = json.loads((LOCALES / lang / "modules.json").read_text(encoding="utf-8"))
missing = []
for m in registry().values():
t = texts.get(m.key, {})
if not t.get("name") or not t.get("description"):
missing.append(m.key)
for lim in m.limits:
if not t.get("limits", {}).get(lim.key):
missing.append(f"{m.key}.limits.{lim.key}")
assert missing == []
assert set(texts) == set(registry()), "texts for modules that don't exist"