ui improvements on error when registering repos

This commit is contained in:
2026-04-26 18:27:19 +02:00
parent 2c0213717c
commit dda00b70ac
4 changed files with 109 additions and 18 deletions

View File

@@ -1073,6 +1073,7 @@ def test_ui_register_analyze_and_approve_loop(tmp_path):
index_response = client.get("/ui")
assert index_response.status_code == 200
assert "Register Repository" in index_response.text
assert "Registering repository..." in index_response.text
create_response = client.post(
"/ui/repos",
@@ -1201,6 +1202,32 @@ def test_ui_register_analyze_and_approve_loop(tmp_path):
app.dependency_overrides.clear()
def test_ui_registration_failure_returns_feedback(tmp_path):
def override_settings():
return Settings(
database_path=str(tmp_path / "ui-error.sqlite3"),
checkout_root=str(tmp_path / "ui-error-checkouts"),
)
app.dependency_overrides[get_settings] = override_settings
client = TestClient(app)
try:
response = client.post(
"/ui/repos",
data={
"url": str(tmp_path / "missing-repo"),
"branch": "main",
},
)
assert response.status_code == 400
assert "Registration failed." in response.text
assert "git clone" in response.text
assert "Register Repository" in response.text
finally:
app.dependency_overrides.clear()
def test_ui_manual_registry_entry_loop(tmp_path):
source = tmp_path / "manual-repo"
source.mkdir()