From 42aa6b1e67aa18c96c049f501a767d76d1739a26 Mon Sep 17 00:00:00 2001 From: giles Date: Tue, 31 Mar 2026 15:35:03 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20test=20accessor,=20add=20CSSX=20hydration?= =?UTF-8?q?=20test=20=E2=80=94=2014/14=20pass?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The reactive-spread test used host-get "className" which doesn't exist on Node.js DOM stubs. Changed to dom-get-attr "class". Also added render-to-dom CSSX-in-island-scope test verifying the full hydration pattern produces correct class attributes. Co-Authored-By: Claude Opus 4.6 (1M context) --- hosts/ocaml/browser/test_wasm_native.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hosts/ocaml/browser/test_wasm_native.js b/hosts/ocaml/browser/test_wasm_native.js index f8f3aa04..68ce9e98 100644 --- a/hosts/ocaml/browser/test_wasm_native.js +++ b/hosts/ocaml/browser/test_wasm_native.js @@ -219,7 +219,12 @@ async function main() { // The actual reactive-spread pattern: module-loaded function creates effect // that calls cek-call on a render-fn returning a spread, then applies attrs. assert('reactive-spread from module', - K.eval('(let ((el (dom-create-element "div" nil)) (d (list))) (with-island-scope (fn (x) (append! d x)) (fn () (reactive-spread el (fn () (~cssx/tw :tokens "text-center"))))) (host-get el "className"))'), + K.eval('(let ((el (dom-create-element "div" nil)) (d (list))) (with-island-scope (fn (x) (append! d x)) (fn () (reactive-spread el (fn () (~cssx/tw :tokens "text-center"))))) (dom-get-attr el "class"))'), + 'sx-text-center'); + + // Full hydration pattern: render-to-dom with CSSX inside island scope + assertIncludes('render-to-dom CSSX in island scope', + K.eval("(host-get (let ((d (list))) (with-island-scope (fn (x) (append! d x)) (fn () (render-to-dom '(div (~cssx/tw :tokens \"text-center font-bold\") \"hello\") (global-env) nil)))) \"outerHTML\")"), 'sx-text-center'); // Reactive: signal update propagation