feat: expose workflow semantic documentation subjects

This commit is contained in:
2026-08-21 15:53:44 +02:00
parent f49ad8eff4
commit 0fd744a2db
10 changed files with 967 additions and 17 deletions
+27 -1
View File
@@ -1,5 +1,6 @@
from __future__ import annotations
from pathlib import Path
import unittest
from govoplan_workflow.backend.manifest import get_manifest
@@ -22,12 +23,37 @@ class WorkflowManifestTests(unittest.TestCase):
self.assertEqual((), manifest.permissions)
self.assertIsNone(manifest.route_factory)
self.assertIsNone(manifest.migration_spec)
self.assertEqual({}, manifest.capability_factories)
self.assertIn("documentation.semantic_subjects.workflow", manifest.capability_factories)
self.assertIn("docs", manifest.optional_dependencies)
self.assertIn(
"documentation.semantic_subjects.workflow",
{item.name for item in manifest.provides_interfaces},
)
self.assertIn(
"workflow.semantic-documentation",
{topic.id for topic in manifest.documentation},
)
self.assertEqual(
"@govoplan/workflow-webui",
manifest.frontend.package_name if manifest.frontend else None,
)
def test_editor_exposes_semantic_help_without_replacing_static_help(self) -> None:
root = Path(__file__).parents[1]
page = (root / "webui/src/features/workflow/WorkflowPage.tsx").read_text()
inspector = (
root / "webui/src/features/workflow/WorkflowInspector.tsx"
).read_text()
self.assertIn("workflow.semantic-documentation", {
topic.id for topic in get_manifest().documentation
})
self.assertIn('"semantic"', page)
self.assertIn('"workflow_definition"', page)
self.assertIn('target="_blank"', page)
self.assertIn('target="_blank"', inspector)
self.assertIn("workflow-node-${nodeId}", inspector)
if __name__ == "__main__":
unittest.main()