AP1.10a: Initiative-Standardfelder vision, Zielzustand und Archetyp-Schlüssel.
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Successful in 1m51s
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 12s
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Successful in 1m51s
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 12s
Migration 016, Archetyp-Registry-API, erweitertes Profil-Modal und Plan-Profil-Ansicht. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
495993cad6
commit
408050bcb8
14 files changed
+342
-40
No files matched your search
@@ -0,0 +1,65 @@
|
||||
"""Initiative-Archetypen & Standardfelder (AP1.10a)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from auth import AUTH_HEADER
|
||||
from tests.factories import provision_user_in_tenant
|
||||
from tests.test_initiatives_actions import _auth, _create_initiative, _login
|
||||
|
||||
|
||||
def test_initiative_archetype_fields(client):
|
||||
user = provision_user_in_tenant(tenant_role="member")
|
||||
token = _login(client, user)
|
||||
|
||||
created = _create_initiative(
|
||||
client,
|
||||
token,
|
||||
title="Produkt Alpha",
|
||||
goal="Kurz-Ziel",
|
||||
vision="Ausführliches Zielbild für Release 1",
|
||||
target_state_summary="MVP live auf Dev",
|
||||
archetype_key="initiative.product",
|
||||
)
|
||||
assert created.status_code == 201
|
||||
body = created.json()
|
||||
assert body["archetype_key"] == "initiative.product"
|
||||
assert body["vision"] == "Ausführliches Zielbild für Release 1"
|
||||
assert body["target_state_summary"] == "MVP live auf Dev"
|
||||
|
||||
updated = client.patch(
|
||||
f"/api/initiatives/{body['id']}",
|
||||
json={
|
||||
"archetype_key": "initiative.program",
|
||||
"vision": "Programm-Vision aktualisiert",
|
||||
},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert updated.status_code == 200
|
||||
assert updated.json()["archetype_key"] == "initiative.program"
|
||||
assert updated.json()["vision"] == "Programm-Vision aktualisiert"
|
||||
|
||||
|
||||
def test_list_entity_archetypes(client):
|
||||
user = provision_user_in_tenant(tenant_role="member")
|
||||
token = _login(client, user)
|
||||
|
||||
res = client.get(
|
||||
"/api/entity-archetypes?entity_type=initiative",
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert res.status_code == 200
|
||||
keys = {item["key"] for item in res.json()}
|
||||
assert keys == {"initiative.generic", "initiative.program", "initiative.product"}
|
||||
|
||||
|
||||
def test_invalid_archetype_rejected(client):
|
||||
user = provision_user_in_tenant(tenant_role="member")
|
||||
token = _login(client, user)
|
||||
|
||||
res = _create_initiative(
|
||||
client,
|
||||
token,
|
||||
title="Bad Archetype",
|
||||
archetype_key="initiative.unknown",
|
||||
)
|
||||
assert res.status_code == 400
|
||||
Reference in new issue
Block a user