feat: Anbindungsdokumentation direkt im Browser anzeigen

This commit is contained in:
2026-11-16 13:50:43 +01:00
parent e0836b1f22
commit acbe23bd7f
13 changed files with 249 additions and 7 deletions

View File

@ -377,3 +377,34 @@ async fn konfigurator_liefert_nutzbare_json_datei_und_geschuetzte_anleitung() {
assert_eq!(a.status(), StatusCode::OK);
assert!(text(a).await.contains("Container"));
}
#[tokio::test]
async fn dokumentation_ist_im_browser_lesbar_und_download_bleibt_erhalten() {
let (_ordner, app, _) = vorbereitung();
let a = anfrage(app.clone(), "/dokumentation", None, true).await;
assert_eq!(a.status(), StatusCode::OK);
assert!(
a.headers()["content-type"]
.to_str()
.unwrap()
.starts_with("text/html")
);
assert_eq!(a.headers()["cache-control"], "no-store");
assert!(a.headers().get("content-disposition").is_none());
let html = text(a).await;
assert!(html.contains("<h2>Was die Anwendung ändern muss</h2>"));
assert!(html.contains("keyforge-client --konfiguration"));
assert!(html.contains("Lokale Prüfung"));
let a = anfrage(app.clone(), "/dokumentation/anbindung.md", None, true).await;
assert!(
a.headers()["content-disposition"]
.to_str()
.unwrap()
.contains("attachment")
);
assert!(text(a).await.starts_with("# Eigene Anwendungen"));
assert_eq!(
anfrage(app, "/dokumentation", None, false).await.status(),
StatusCode::SEE_OTHER
);
}