Fix test accessor, add CSSX hydration test — 14/14 pass
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) <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user