|
|
@@ -182,6 +182,42 @@ def run(ctx):
|
|
|
check(detail.get("draft") is True and detail.get("enqueue") is not None
|
|
|
and detail.get("delete") is not None,
|
|
|
"draft tasks expose the enqueue + delete actions")
|
|
|
+
|
|
|
+ print("== B6b: create-form branch fields (goal 16) ==")
|
|
|
+ # The queue form carries both branch rows; they post through
|
|
|
+ # tasks.create into the stored task (empty optional -> null,
|
|
|
+ # branch_from prefill from the project's default branch).
|
|
|
+ tasks_page = http_get_page(auth, "/tasks")
|
|
|
+ check('name="task_branch"' in tasks_page and "Task branch name" in tasks_page,
|
|
|
+ "the create form renders the Task branch name input")
|
|
|
+ check('name="branch_from"' in tasks_page and "Branch from" in tasks_page,
|
|
|
+ "the create form renders the Branch from input")
|
|
|
+ check("default: the project's default branch" in tasks_page,
|
|
|
+ "the Branch from label hints at the project default")
|
|
|
+ act(auth, slot_public(auth, "/tasks", "tasks")["create"], {
|
|
|
+ "project_id": "1",
|
|
|
+ "title": "Branch fields task",
|
|
|
+ "priority": "5",
|
|
|
+ "task_branch": "task/999-branch-fields",
|
|
|
+ "branch_from": "release/2026",
|
|
|
+ })
|
|
|
+ detail = task_state(auth, task_id_of("Branch fields task"))
|
|
|
+ check(detail["task_branch"] == "task/999-branch-fields"
|
|
|
+ and detail["branch_from"] == "release/2026",
|
|
|
+ "posted branch fields store on the created task")
|
|
|
+ # Both optional: empty posts leave task_branch null and prefill
|
|
|
+ # branch_from from the project's default branch (demo -> main).
|
|
|
+ act(auth, slot_public(auth, "/tasks", "tasks")["create"], {
|
|
|
+ "project_id": "1",
|
|
|
+ "title": "Default branch fields task",
|
|
|
+ "priority": "5",
|
|
|
+ })
|
|
|
+ detail = task_state(auth, task_id_of("Default branch fields task"))
|
|
|
+ check((detail.get("task_branch") is None
|
|
|
+ or detail.get("task_branch") == "")
|
|
|
+ and detail.get("branch_from") == "main",
|
|
|
+ "empty posts leave task_branch null and prefill branch_from"
|
|
|
+ " from the project default")
|
|
|
check(quiet_window(quiet_seconds(),
|
|
|
lambda: task_state(auth, draft_display)["status"] == "draft",
|
|
|
"draft task never dispatches"),
|