feat(runtime): add URL-state GET navigation

This commit is contained in:
slhx agent
2026-06-29 18:21:00 +02:00
parent 9dd8e4a944
commit d0e7022c86
10 changed files with 185 additions and 97 deletions
+15
View File
@@ -43,6 +43,21 @@ fn runtime_posts_urlencoded_forms_by_default() {
assert!(source.contains("application/x-www-form-urlencoded;charset=UTF-8"));
}
#[test]
fn runtime_turns_page_get_forms_into_url_state_navigation() {
// req: page_swap/009 req: page_swap/010
let source = hemx_js::RUNTIME_JS;
assert!(source.contains("function pageFormHistoryMode(source, form)"));
assert!(source.contains("const mode = method === \"GET\" && form && pageFormHistoryMode(source, form)"));
assert!(source.contains("if (mode)"));
assert!(source.contains("await navigateUrl(pageRequestUrl(form, source), rootOf(form) || rootOf(el), mode)"));
assert!(source.contains("function successfulFormData(form, source)"));
assert!(source.contains("new FormData(form, source)"));
assert!(source.contains("data-hemx-nav"));
assert!(source.contains("data-hemx-history"));
}
#[test]
fn runtime_preserves_multipart_file_upload_fallback_shape() {
// req: multipart/003