Tests: align cek content-page names with injector output

Load sx/sx/geography/cek/ recursively so content/demo/freeze index.sx
pages bind as ~geography/cek/{content,demo,freeze}. Update docs.sx
cek-page dispatch + test-examples cek:content-pages suite to reference
those real names (were stale ~geography/cek/cek-content etc.).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-22 10:58:17 +00:00
parent ebcb5348ba
commit ce7ad3eead
3 changed files with 14 additions and 16 deletions

View File

@@ -2483,7 +2483,9 @@ let run_spec_tests env test_files =
(* Load one-per-file islands from _islands/ directories.
Using sx_sx_dir as base matches the live server's naming:
sx/sx/geography/<domain>/_islands/<stem>.sx -> ~geography/<domain>/<stem>. *)
load_dir_recursive (Filename.concat sx_geo_dir "cek/_islands") sx_sx_dir;
(* cek/: recursive load picks up content/demo/freeze page index.sx files
(→ ~geography/cek/content etc.) plus _islands/*.sx (→ ~geography/cek/<stem>). *)
load_dir_recursive (Filename.concat sx_geo_dir "cek") sx_sx_dir;
let sx_reactive_dir = Filename.concat sx_geo_dir "reactive" in
if Sys.file_exists (Filename.concat sx_reactive_dir "_islands") then
load_dir_recursive (Filename.concat sx_reactive_dir "_islands") sx_sx_dir;

View File

@@ -874,7 +874,7 @@
:path "/geography/cek/"
:auth :public
:layout :sx-docs
:content (~layouts/doc :path "/sx/(geography.(cek))" (~geography/cek/cek-content)))
:content (~layouts/doc :path "/sx/(geography.(cek))" (~geography/cek)))
;; ---------------------------------------------------------------------------
;; Bootstrapped page helpers demo
@@ -890,8 +890,12 @@
(case
slug
"demo"
(~geography/cek/cek-demo-content)
:else (~geography/cek/cek-content))))
(~geography/cek/demo)
"freeze"
(~geography/cek/freeze)
"content"
(~geography/cek/content)
:else (~geography/cek))))
;; ---------------------------------------------------------------------------
;; Testing section

View File

@@ -298,18 +298,10 @@
(defsuite
"cek:content-pages"
(deftest
"cek-content"
(assert-true (component? ~geography/cek/cek-content)))
(deftest
"cek-demo-content"
(assert-true (component? ~geography/cek/cek-demo-content)))
(deftest
"cek-freeze-content"
(assert-true (component? ~geography/cek/cek-freeze-content)))
(deftest
"cek-content-address-content"
(assert-true (component? ~geography/cek/cek-content-address-content))))
(deftest "cek-index" (assert-true (component? ~geography/cek)))
(deftest "cek-content" (assert-true (component? ~geography/cek/content)))
(deftest "cek-demo" (assert-true (component? ~geography/cek/demo)))
(deftest "cek-freeze" (assert-true (component? ~geography/cek/freeze))))
(defsuite
"reactive:islands"