rebuild(stage-14): deliver migration and recovery tooling
This commit is contained in:
@@ -73,3 +73,21 @@ def test_validation_error_does_not_expose_framework_details(tmp_path) -> None:
|
||||
assert response.status_code == 422
|
||||
assert response.json()["error"]["code"] == "invalid_request"
|
||||
assert "integer" not in response.text.lower()
|
||||
|
||||
|
||||
def test_production_frontend_serves_spa_without_capturing_api_404(tmp_path) -> None:
|
||||
settings = Settings.for_test(tmp_path)
|
||||
settings.frontend_dist_directory.mkdir(parents=True)
|
||||
settings.frontend_dist_directory.joinpath("index.html").write_text(
|
||||
"<main>application</main>", encoding="utf-8"
|
||||
)
|
||||
settings.frontend_dist_directory.joinpath("asset.js").write_text(
|
||||
"window.ready=true", encoding="utf-8"
|
||||
)
|
||||
application = create_application(settings)
|
||||
|
||||
assert request(application, "/review/history").text == "<main>application</main>"
|
||||
assert request(application, "/asset.js").text == "window.ready=true"
|
||||
api_response = request(application, "/api/unknown")
|
||||
assert api_response.status_code == 404
|
||||
assert api_response.json()["error"]["code"] == "not_found"
|
||||
|
||||
Reference in New Issue
Block a user