feat(webui): complete bounded work quick access

This commit is contained in:
2026-08-19 19:28:14 +02:00
parent a8646e76a8
commit 39bb6c0d18
5 changed files with 291 additions and 8 deletions
+39
View File
@@ -0,0 +1,39 @@
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_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()