Add oneliner to case view

Introduce an `oneliner` field to the `CaseView` struct and update the
`scan_cases` function to read it from `oneliner.txt`. The `cases.html`
template is updated to display the oneliner if present. A new
integration test is added to verify the functionality.
This commit is contained in:
2026-04-13 19:23:35 +02:00
parent 33da841087
commit d3ef78796d
3 changed files with 21 additions and 0 deletions
+8
View File
@@ -98,6 +98,7 @@ async fn web_index_shows_cases() {
"Herzkatheter ohne Befund.",
)
.unwrap();
std::fs::write(done_case.join("oneliner.txt"), "Herzkatheter unauffällig").unwrap();
let app = doctate_server::create_router(config);
let response = app
@@ -122,6 +123,13 @@ async fn web_index_shows_cases() {
assert!(body.contains("Transcription pending"));
// case2 has a transcript → rendered
assert!(body.contains("Herzkatheter ohne Befund."));
// case2 has an oneliner → rendered exactly once (case1 has none)
assert!(body.contains("Herzkatheter unauffällig"));
assert_eq!(
body.matches("class=\"oneliner\"").count(),
1,
"expected exactly one oneliner div"
);
let _ = std::fs::remove_dir_all(&data_path);
}