test(js): cover interval dispatch

Cover data-slhx-every runtime behavior: root scanning, duplicate timer avoidance, interval dispatch, and cleanup when elements leave the document.

req: convention/005
This commit is contained in:
slhx agent
2026-05-25 23:01:06 +02:00
parent f02b4de1ad
commit d72524e501
+11
View File
@@ -9,6 +9,17 @@ fn runtime_posts_urlencoded_forms_by_default() {
assert!(source.contains("application/x-www-form-urlencoded;charset=UTF-8"));
}
#[test]
fn runtime_interval_dispatch_avoids_duplicate_timers() {
// req: convention/005
let source = slhx_js::RUNTIME_JS;
assert!(source.contains("root.querySelectorAll(\"[data-slhx-every]\")"));
assert!(source.contains("if (timers.has(el)) return"));
assert!(source.contains("setInterval(() => document.contains(el) ? send(el, \"every\")"));
assert!(source.contains("clearInterval(timers.get(el))"));
}
#[test]
fn runtime_toggles_pending_conventions_around_requests() {
// req: convention/007 req: convention/008