fix: test suite — seed reset, FK mappings, standalone focus tests

- Change all seed inserts from ON CONFLICT DO NOTHING to DO UPDATE SET
  so seeds always reset to canonical values between test runs
- Add meeting_id, decision_id, link_id to FK_FIELD_MAP in form_factory
- Add item_ids, direction, label, content to NAME_PATTERNS
- Add TestStandaloneFocusItems (7 tests): quick-add, edit, project tab
- Add TestFocusConversion (6 tests): convert to task/note/link/list item
- Add focus_standalone seed with fixture
- Update focus_page_loads test for permanent (non-date-scoped) items
- All 398 tests passing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-04 03:08:53 +00:00
parent a61248b67d
commit a2183af6e2
3 changed files with 386 additions and 33 deletions

View File

@@ -24,15 +24,18 @@ from tests.introspect import FormField
# FK fields map to seed fixture keys
FK_FIELD_MAP = {
"domain_id": "domain",
"quick_domain_id": "domain",
"area_id": "area",
"project_id": "project",
"task_id": "task",
"folder_id": "weblink_folder",
"parent_id": None, # Usually optional, skip
"meeting_id": None,
"meeting_id": "meeting",
"contact_id": "contact",
"release_id": None,
"note_id": "note",
"link_id": "link",
"decision_id": "decision",
"list_id": "list",
"process_id": "process",
"run_id": "process_run",
@@ -80,6 +83,11 @@ NAME_PATTERNS: list[tuple[str, Any]] = [
("notes", "Test notes field"),
("weekly_hours", "10"),
("effective_from", None), # Resolved dynamically as date
("item_ids", ""), # Comma-separated UUIDs for reorder
("item_id", ""), # Single item ID for reorder
("direction", "up"), # Reorder direction
("label", "Test Label Auto"), # Link label
("content", "Test content"), # List item content
]