test(js): cover pending conventions

Cover pending-class, indicator visibility, and disable-while-pending runtime conventions around request execution.

req: convention/007

req: convention/008
This commit is contained in:
slhx agent
2026-05-25 22:57:22 +02:00
parent 77b6aba336
commit f02b4de1ad
+16
View File
@@ -9,6 +9,22 @@ fn runtime_posts_urlencoded_forms_by_default() {
assert!(source.contains("application/x-www-form-urlencoded;charset=UTF-8"));
}
#[test]
fn runtime_toggles_pending_conventions_around_requests() {
// req: convention/007 req: convention/008
let source = slhx_js::RUNTIME_JS;
assert!(source.contains("function showPending(el, on)"));
assert!(source.contains("el.getAttribute(\"data-slhx-pending-class\")"));
assert!(source.contains("el.classList.toggle(klass, on)"));
assert!(source.contains("root.querySelectorAll(\"[data-slhx-indicator]\")"));
assert!(source.contains("i.hidden = !on"));
assert!(source.contains("el.hasAttribute(\"data-slhx-disable-while-pending\")"));
assert!(source.contains("c.disabled = on"));
assert!(source.contains("showPending(target, true)"));
assert!(source.contains("showPending(target, false)"));
}
#[test]
fn runtime_confirms_before_handler_dispatch() {
// req: convention/004