All checks were successful
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Successful in 3m56s
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 19s
Test Suite / playwright-smoke (push) Successful in 13s
backlog_epic_hierarchy als Steuerungselement, effektive steering_elements im Operating Context, Backend-Guards und UI ohne Slice-Ifs. Co-authored-by: Cursor <cursoragent@cursor.com>
78 lines
2.5 KiB
Python
78 lines
2.5 KiB
Python
"""AP2.2g — Profilgebundenes Backlog-Vokabular (ADP P3)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from tests.factories import provision_user_in_tenant
|
|
from tests.test_initiatives_actions import _auth, _create_initiative, _login
|
|
|
|
|
|
def test_operating_context_product_has_agile_backlog_vocabulary(client):
|
|
user = provision_user_in_tenant(tenant_role="admin")
|
|
token = _login(client, user)
|
|
|
|
created = _create_initiative(
|
|
client,
|
|
token,
|
|
title="Product Vocab",
|
|
archetype_key="initiative.product",
|
|
)
|
|
initiative_id = created.json()["id"]
|
|
|
|
res = client.get(
|
|
f"/api/initiatives/{initiative_id}/operating-context",
|
|
headers=_auth(token),
|
|
)
|
|
assert res.status_code == 200
|
|
vocab = res.json()["backlog_vocabulary"]
|
|
assert vocab["profile_key"] == "agile_intake"
|
|
assert "epic" in vocab["kinds"]
|
|
assert vocab["labels"]["story"] == "Story"
|
|
assert vocab["capabilities"]["epic_hierarchy"] is True
|
|
assert vocab["capabilities"]["sprint_commit"] is True
|
|
assert "backlog_epic_hierarchy" in res.json()["steering_elements"]
|
|
|
|
|
|
def test_operating_context_linear_has_standard_backlog_vocabulary(client):
|
|
user = provision_user_in_tenant(tenant_role="admin")
|
|
token = _login(client, user)
|
|
|
|
created = _create_initiative(
|
|
client,
|
|
token,
|
|
title="Linear Vocab",
|
|
archetype_key="initiative.linear_project",
|
|
)
|
|
initiative_id = created.json()["id"]
|
|
|
|
res = client.get(
|
|
f"/api/initiatives/{initiative_id}/operating-context",
|
|
headers=_auth(token),
|
|
)
|
|
vocab = res.json()["backlog_vocabulary"]
|
|
assert vocab["profile_key"] == "standard_intake"
|
|
assert vocab["kinds"] == ["story", "bug", "issue"]
|
|
assert "epic" not in vocab["kinds"]
|
|
assert vocab["capabilities"]["epic_hierarchy"] is False
|
|
assert "backlog_epic_hierarchy" not in res.json()["steering_elements"]
|
|
|
|
|
|
def test_linear_initiative_rejects_epic_backlog_item(client):
|
|
user = provision_user_in_tenant(tenant_role="admin")
|
|
token = _login(client, user)
|
|
|
|
created = _create_initiative(
|
|
client,
|
|
token,
|
|
title="Linear Epic Block",
|
|
archetype_key="initiative.linear_project",
|
|
)
|
|
initiative_id = created.json()["id"]
|
|
|
|
epic = client.post(
|
|
f"/api/initiatives/{initiative_id}/backlog",
|
|
json={"title": "Not allowed", "item_kind": "epic", "status": "new"},
|
|
headers=_auth(token),
|
|
)
|
|
assert epic.status_code == 400
|
|
assert "nicht erlaubt" in epic.json()["detail"]
|