generated from coulomb/repo-seed
browser-side edit/delete controls
This commit is contained in:
@@ -506,6 +506,79 @@ def test_ui_manual_registry_entry_loop(tmp_path):
|
||||
assert "Manual API" in detail_response.text
|
||||
assert "README.md" in detail_response.text
|
||||
assert "ID " in detail_response.text
|
||||
assert "Save Ability" in detail_response.text
|
||||
|
||||
edit_ability_response = client.post(
|
||||
f"{repository_path}/abilities/{ability_id}/edit",
|
||||
data={
|
||||
"name": "Edited Manual Ability",
|
||||
"description": "Edited by hand.",
|
||||
"confidence": "0.8",
|
||||
},
|
||||
follow_redirects=False,
|
||||
)
|
||||
assert edit_ability_response.status_code == 303
|
||||
|
||||
edit_capability_response = client.post(
|
||||
f"{repository_path}/capabilities/{capability_id}/edit",
|
||||
data={
|
||||
"name": "Edited Manual Capability",
|
||||
"description": "Edited capability.",
|
||||
"inputs": "ticket",
|
||||
"outputs": "decision",
|
||||
"confidence": "0.75",
|
||||
},
|
||||
follow_redirects=False,
|
||||
)
|
||||
assert edit_capability_response.status_code == 303
|
||||
|
||||
ability_map = client.get(f"/repos/{repository_id}/ability-map").json()
|
||||
feature_id = ability_map["abilities"][0]["capabilities"][0]["features"][0]["id"]
|
||||
evidence_id = ability_map["abilities"][0]["capabilities"][0]["evidence"][0]["id"]
|
||||
|
||||
edit_feature_response = client.post(
|
||||
f"{repository_path}/features/{feature_id}/edit",
|
||||
data={
|
||||
"name": "Edited Manual API",
|
||||
"type": "HTTP endpoint",
|
||||
"location": "src/edited.py",
|
||||
"confidence": "0.7",
|
||||
},
|
||||
follow_redirects=False,
|
||||
)
|
||||
assert edit_feature_response.status_code == 303
|
||||
|
||||
edit_evidence_response = client.post(
|
||||
f"{repository_path}/evidence/{evidence_id}/edit",
|
||||
data={
|
||||
"type": "test",
|
||||
"reference": "tests/test_manual.py",
|
||||
"strength": "strong",
|
||||
},
|
||||
follow_redirects=False,
|
||||
)
|
||||
assert edit_evidence_response.status_code == 303
|
||||
|
||||
detail_response = client.get(repository_path)
|
||||
assert "Edited Manual Ability" in detail_response.text
|
||||
assert "Edited Manual Capability" in detail_response.text
|
||||
assert "Edited Manual API" in detail_response.text
|
||||
assert "tests/test_manual.py" in detail_response.text
|
||||
|
||||
delete_feature_response = client.post(
|
||||
f"{repository_path}/features/{feature_id}/delete",
|
||||
follow_redirects=False,
|
||||
)
|
||||
assert delete_feature_response.status_code == 303
|
||||
delete_evidence_response = client.post(
|
||||
f"{repository_path}/evidence/{evidence_id}/delete",
|
||||
follow_redirects=False,
|
||||
)
|
||||
assert delete_evidence_response.status_code == 303
|
||||
|
||||
detail_response = client.get(repository_path)
|
||||
assert "Edited Manual API" not in detail_response.text
|
||||
assert "tests/test_manual.py" not in detail_response.text
|
||||
finally:
|
||||
app.dependency_overrides.clear()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user