AP2.2e: Unplan, Bug/Issue-Referenz und Sprint-Lebenszyklus.
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 2m52s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 13s
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 2m52s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 13s
Ermöglicht APs zurück in den Eingang zu schieben, Bugs/Issues mit Feature-Bezug zu planen und den Scrum-Sprint-Ablauf in der UI. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
e221b5b09f
commit
e65838118c
21 files changed
+794
-14
No files matched your search
@@ -0,0 +1,172 @@
|
||||
"""AP2.2e — Unplan, Bug/Issue mit Feature-Referenz, Sprint-Lifecycle."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from tests.factories import provision_user_in_tenant
|
||||
from tests.test_initiatives_actions import _auth, _create_initiative, _login
|
||||
|
||||
|
||||
def test_unplan_action_restores_backlog(client):
|
||||
user = provision_user_in_tenant(tenant_role="admin")
|
||||
token = _login(client, user)
|
||||
|
||||
created = _create_initiative(
|
||||
client,
|
||||
token,
|
||||
title="Sprint Planung E2E",
|
||||
archetype_key="initiative.product",
|
||||
)
|
||||
initiative_id = created.json()["id"]
|
||||
|
||||
cycle = client.post(
|
||||
f"/api/initiatives/{initiative_id}/work-cycles",
|
||||
json={"title": "Sprint 1", "status": "planned"},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert cycle.status_code == 201
|
||||
cycle_id = cycle.json()["id"]
|
||||
|
||||
backlog = client.post(
|
||||
f"/api/initiatives/{initiative_id}/backlog",
|
||||
json={"title": "Story A", "status": "accepted"},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert backlog.status_code == 201
|
||||
backlog_id = backlog.json()["id"]
|
||||
|
||||
converted = client.post(
|
||||
f"/api/backlog/{backlog_id}/convert-to-action",
|
||||
json={"work_cycle_id": cycle_id, "assign_active_sprint": False},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert converted.status_code == 201
|
||||
action_id = converted.json()["action"]["id"]
|
||||
assert converted.json()["backlog_item"]["status"] == "converted"
|
||||
|
||||
unplan = client.post(
|
||||
f"/api/actions/{action_id}/unplan-to-backlog",
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert unplan.status_code == 200
|
||||
body = unplan.json()
|
||||
assert body["backlog_item"]["status"] == "accepted"
|
||||
assert body["backlog_item"]["id"] == backlog_id
|
||||
assert body["backlog_item"]["converted_action_id"] is None
|
||||
assert body["action"]["status"] == "discarded"
|
||||
assert body["action"]["work_cycle_id"] is None
|
||||
|
||||
|
||||
def test_unplan_rejects_in_progress(client):
|
||||
user = provision_user_in_tenant(tenant_role="admin")
|
||||
token = _login(client, user)
|
||||
|
||||
created = _create_initiative(
|
||||
client,
|
||||
token,
|
||||
title="Unplan Guard",
|
||||
archetype_key="initiative.product",
|
||||
)
|
||||
initiative_id = created.json()["id"]
|
||||
|
||||
action = client.post(
|
||||
f"/api/initiatives/{initiative_id}/actions",
|
||||
json={"title": "Laufendes AP", "status": "in_progress"},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert action.status_code == 201
|
||||
action_id = action.json()["id"]
|
||||
|
||||
unplan = client.post(
|
||||
f"/api/actions/{action_id}/unplan-to-backlog",
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert unplan.status_code == 400
|
||||
|
||||
|
||||
def test_backlog_bug_with_feature_reference(client):
|
||||
user = provision_user_in_tenant(tenant_role="admin")
|
||||
token = _login(client, user)
|
||||
|
||||
created = _create_initiative(
|
||||
client,
|
||||
token,
|
||||
title="Bug Ref",
|
||||
archetype_key="initiative.product",
|
||||
)
|
||||
initiative_id = created.json()["id"]
|
||||
|
||||
cycle = client.post(
|
||||
f"/api/initiatives/{initiative_id}/work-cycles",
|
||||
json={"title": "Sprint 1", "status": "planned"},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert cycle.status_code == 201
|
||||
cycle_id = cycle.json()["id"]
|
||||
|
||||
feature = client.post(
|
||||
f"/api/initiatives/{initiative_id}/actions",
|
||||
json={"title": "Login Feature", "action_kind": "delivery"},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert feature.status_code == 201
|
||||
feature_id = feature.json()["id"]
|
||||
|
||||
bug = client.post(
|
||||
f"/api/initiatives/{initiative_id}/backlog",
|
||||
json={
|
||||
"title": "Login-Button kaputt",
|
||||
"status": "accepted",
|
||||
"item_kind": "bug",
|
||||
"parent_action_id": feature_id,
|
||||
},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert bug.status_code == 201
|
||||
assert bug.json()["item_kind"] == "bug"
|
||||
assert bug.json()["parent_action_id"] == feature_id
|
||||
|
||||
converted = client.post(
|
||||
f"/api/backlog/{bug.json()['id']}/convert-to-action",
|
||||
json={"work_cycle_id": cycle_id, "assign_active_sprint": False},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert converted.status_code == 201
|
||||
action = converted.json()["action"]
|
||||
assert action["action_kind"] == "bug"
|
||||
assert action["parent_action_id"] == feature_id
|
||||
assert action["work_cycle_id"] == cycle_id
|
||||
|
||||
|
||||
def test_complete_sprint_reports_open_actions(client):
|
||||
user = provision_user_in_tenant(tenant_role="admin")
|
||||
token = _login(client, user)
|
||||
|
||||
created = _create_initiative(
|
||||
client,
|
||||
token,
|
||||
title="Complete Stats",
|
||||
archetype_key="initiative.product",
|
||||
)
|
||||
initiative_id = created.json()["id"]
|
||||
|
||||
cycle = client.post(
|
||||
f"/api/initiatives/{initiative_id}/work-cycles",
|
||||
json={"title": "Sprint Active", "status": "active"},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert cycle.status_code == 201
|
||||
cycle_id = cycle.json()["id"]
|
||||
|
||||
client.post(
|
||||
f"/api/initiatives/{initiative_id}/actions",
|
||||
json={"title": "Offen", "work_cycle_id": cycle_id, "status": "open"},
|
||||
headers=_auth(token),
|
||||
)
|
||||
|
||||
completed = client.post(
|
||||
f"/api/initiatives/{initiative_id}/work-cycles/{cycle_id}/complete",
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert completed.status_code == 200
|
||||
assert completed.json()["status"] == "reached"
|
||||
assert completed.json()["open_action_count_at_completion"] == 1
|
||||
Reference in new issue
Block a user