fix: Inline recording-delete confirm + stable redirects
- Replace native confirm() in the recording list with an inline
two-step confirm row; hide the player via visibility:hidden
while open so the row height stays stable.
- Hard-redirect recording delete back to /web/cases/{id}/recordings
instead of relying on the Referer header (which silently fell
back to /web/cases when stripped).
- Switch analyze/reset to a hidden return_to form field so the
source page (case detail vs. case list) is preserved reliably,
with same-origin /web/ prefix validation.
- Tighten delete_recording_test on the concrete Location header;
adjust analyze/reset redirect expectations to the new
case-detail fallback.
This commit is contained in:
@@ -54,6 +54,14 @@ async fn delete_recording_removes_file_and_sidecars_and_invalidates_derived() {
|
||||
"delete should redirect (3xx), got {}",
|
||||
resp.status()
|
||||
);
|
||||
let expected_location = format!("/web/cases/{case_id}/recordings");
|
||||
assert_eq!(
|
||||
resp.headers()
|
||||
.get(axum::http::header::LOCATION)
|
||||
.and_then(|v| v.to_str().ok()),
|
||||
Some(expected_location.as_str()),
|
||||
"delete should redirect back to the recording list, not the case list"
|
||||
);
|
||||
|
||||
// Victim + its sidecars are gone.
|
||||
assert!(!case_dir.join(&victim).exists(), "m4a should be deleted");
|
||||
@@ -212,6 +220,14 @@ async fn delete_last_recording_clears_case() {
|
||||
"last-recording delete should still redirect, got {}",
|
||||
resp.status()
|
||||
);
|
||||
let expected_location = format!("/web/cases/{case_id}/recordings");
|
||||
assert_eq!(
|
||||
resp.headers()
|
||||
.get(axum::http::header::LOCATION)
|
||||
.and_then(|v| v.to_str().ok()),
|
||||
Some(expected_location.as_str()),
|
||||
"last-recording delete should still redirect to the recording list"
|
||||
);
|
||||
|
||||
assert!(!case_dir.join(&only).exists());
|
||||
assert!(!case_dir.join(ONELINER_FILENAME).exists());
|
||||
|
||||
Reference in New Issue
Block a user