host: live 2-field composition demo (Landing type: :body + :aside)
host/blog-seed-landing-demo! (+ host/blog--seed-card! fixed-slug helper): a Landing TYPE with TWO composition fields — :body (heading/text/image + cond/each) and :aside (text/callout, no controls) — plus a populated landing-demo instance, wired into serve.sh (survives wipes), idempotent (fixed card slugs, set-comp! overwrites). /landing-demo/ renders both fields; its edit page shows two independent block editors (#comp-body, #comp-aside); /landing/ reads the two-field definition. Demonstrates layer 2 end to end on the live site. blog 196/196 (+ tests: idempotent 2-field seed, both fields render). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1062,6 +1062,20 @@
|
||||
(contains? (render-page (host/blog--type-population "card")) "Subtypes") true)
|
||||
(host-bl-test "GET /article/ shows the Population section"
|
||||
(contains? (dream-resp-body (host-bl-app (host-bl-req "/article/"))) "Population") true)
|
||||
;; the Landing demo: a type with TWO composition fields, an instance populated in both,
|
||||
;; idempotent (re-seeding doesn't duplicate). Renders both fields; the aside forbids controls.
|
||||
(host-bl-test "the landing demo seeds a 2-field type + instance (idempotent)"
|
||||
(begin
|
||||
(host/blog-seed-landing-demo!) (host/blog-seed-landing-demo!) ;; twice -> must not duplicate
|
||||
(list (host/blog--composition-fields "landing-demo")
|
||||
(len (host/blog--comp-nodes "landing-demo" "body"))
|
||||
(len (host/blog--comp-nodes "landing-demo" "aside"))
|
||||
(host/blog--allows-control? "landing-demo" "aside" "cond")))
|
||||
(list (list "body" "aside") 2 2 false))
|
||||
(host-bl-test "GET /landing-demo/ renders BOTH composition fields"
|
||||
(let ((html (dream-resp-body (host-bl-app (host-bl-req "/landing-demo/")))))
|
||||
(list (contains? html "Welcome to the Landing Demo") (contains? html "ASIDE composition")))
|
||||
(list true true))
|
||||
;; the editor renders a HAND-AUTHORED composition (text/row/alt-with-text) WITHOUT falling
|
||||
;; through to "(unknown block)" — every node kind gets a labelled row (the compose-demo case).
|
||||
(host-bl-test "the block editor renders text/layout/inline-alt nodes (no unknown block)"
|
||||
|
||||
Reference in New Issue
Block a user