Files
govoplan-tasks/tests/test_webui_contract.py
T
zemion ee7dbd99b8 fix(ui): align contextual documentation with headings
Verified with the coordinated workspace changes by devkit full run
2026-09-08T225814-186389-0000-3e3ed7cd (all seven phases passed).
This shared UI pass does not mark the individual module reviews complete.
2026-09-09 02:04:14 +02:00

60 lines
2.0 KiB
Python

from __future__ import annotations
from pathlib import Path
import unittest
from govoplan_tasks.backend.manifest import get_manifest
REPOSITORY_ROOT = Path(__file__).resolve().parents[1]
class TasksQuickAccessContractTests(unittest.TestCase):
def test_public_topics_have_complete_german_workflow_and_reference_coverage(
self,
) -> None:
topics = get_manifest().documentation
kinds = {topic.metadata.get("kind", "system") for topic in topics}
self.assertEqual({
"tasks.workspace-layout",
"tasks.data-subject-requests",
"tasks.quick-access-and-product-area",
"tasks.work-inbox",
}, {topic.id for topic in topics})
self.assertTrue({"workflow", "reference"}.issubset(kinds))
for topic in topics:
translation = topic.translations["de"]
self.assertEqual({"title", "summary", "body"}, set(translation))
self.assertTrue(
all(str(translation[field]).strip() for field in translation)
)
def test_manifest_declares_typed_work_result_and_help(self) -> None:
tool = get_manifest().frontend.quick_access_tools[0]
self.assertEqual("tasks.work", tool.id)
self.assertEqual(("tasks.work-item",), tool.returned_reference_kinds)
self.assertEqual("tasks.quick_access.work", tool.help_context_id)
self.assertEqual("/tasks", tool.full_page_path)
def test_renderer_is_bounded_and_keeps_commands_source_owned(self) -> None:
source = (
REPOSITORY_ROOT
/ "webui"
/ "src"
/ "features"
/ "tasks"
/ "TasksQuickAccess.tsx"
).read_text()
self.assertIn("limit: 7", source)
self.assertIn('selected.provider_id !== "tasks.explicit"', source)
self.assertIn("transitionTask(settings, selected, action)", source)
self.assertIn("quickAccessLaunchState(launchContext)", source)
self.assertIn('kind: "work-item"', source)
if __name__ == "__main__":
unittest.main()