From 77b6aba336d3021d3dc7da1d6ac35eaec91fa45c Mon Sep 17 00:00:00 2001 From: slhx agent Date: Mon, 25 May 2026 22:55:11 +0200 Subject: [PATCH] test(js): cover confirm dispatch guard Cover data-slhx-confirm as a runtime convention boundary: confirmation happens before handler dispatch continues. req: convention/004 --- slhx-js/tests/runtime.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/slhx-js/tests/runtime.rs b/slhx-js/tests/runtime.rs index 3192c10..693e921 100644 --- a/slhx-js/tests/runtime.rs +++ b/slhx-js/tests/runtime.rs @@ -9,6 +9,15 @@ fn runtime_posts_urlencoded_forms_by_default() { assert!(source.contains("application/x-www-form-urlencoded;charset=UTF-8")); } +#[test] +fn runtime_confirms_before_handler_dispatch() { + // req: convention/004 + let source = slhx_js::RUNTIME_JS; + + assert!(source.contains("el.getAttribute(\"data-slhx-confirm\") && !confirm(el.getAttribute(\"data-slhx-confirm\"))")); + assert!(source.contains("return;")); +} + #[test] fn runtime_fetches_with_same_origin_credentials() { // req: auth/005