;; AUTO-GENERATED from spec/tests/hyperscript-upstream-tests.json
;; DO NOT EDIT — regenerate with:
;;   python3 tests/playwright/generate-sx-tests.py --emit-pages

(defcomp ()
  (~docs/page :title "Hyperscript: assignableElements (8 tests — 0 runnable)"
    (p :style "color:#57534e;margin-bottom:1rem" "Live cards for the upstream assignableElements tests. 0 of 8 are reproducible in-browser; the remainder show their source for reference.")
    (p :style "color:#78716c;font-size:0.875rem;margin-bottom:1rem"
      "Theme: " (a :href "/sx/(applications.(hyperscript.gallery-language))"
        :style "color:#7c3aed" "language"))
    (div :style "display:flex;flex-direction:column"
      (~hyperscript/hs-test-card
  :name "set #id replaces element with HTML string"
  :html "<div id='target'>old</div><button _='on click set #target to \\\"<span id=target>new</span>\\\"'>go</button>"
  :action "find('button').dispatchEvent('click')"
  :check "toHaveText(\"new\"); toBe(\"SPAN\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "set #id replaces element with another element"
  :html "<div id='target'>old</div><button _='on click make a <span.replaced/> then put \\\"moved\\\" into it then set #target to it'>go</button>"
  :action "find('button').dispatchEvent('click')"
  :check "toBe(\"moved\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "set .class replaces all matching elements"
  :html "<ul id='list'>  <li class='item'>a</li>  <li class='item'>b</li>  <li class='item'>c</li></ul><button _='on click set .item to \\\"<li class=item>replaced</li>\\\"'>go</button>"
  :action "find('button').dispatchEvent('click')"
  :check "toBe(3); toEqual([\"replaced\", \"replaced\", \"replaced\"])"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "set <query/> replaces all matching elements"
  :html "<div id='box'>  <p>one</p>  <p>two</p></div><button _='on click set <p/> in #box to \\\"<p>done</p>\\\"'>go</button>"
  :action "find('button').dispatchEvent('click')"
  :check "toEqual([\"done\", \"done\"])"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "set closest replaces ancestor"
  :html "<div class='wrapper'><button _='on click set (closest <div/>) to \\\"<div class=wrapper>replaced</div>\\\"'>go</button></div>"
  :action "find('button').dispatchEvent('click')"
  :check "toHaveText(\"replaced\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "hyperscript in replacement content is initialized"
  :html "<div id='target'>old</div><button id='go' _=\\\"on click set #target to '<div id=target _=&#34;on click put `clicked` into me&#34;>new</div>'\\\">go</button>"
  :action "find('#go').dispatchEvent('click'); find('#target').dispatchEvent('click')"
  :check "toHaveText(\"new\"); toHaveText(\"clicked\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "swap #a with #b swaps DOM positions"
  :html "<div id='container'>  <div id='a'>A</div>  <div id='b'>B</div></div><button _='on click swap #a with #b'>go</button>"
  :action "find('button').dispatchEvent('click')"
  :check "toEqual([\"B\", \"A\"])"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "put into still works as innerHTML"
  :html "<div id='target'>old</div><button _='on click put \\\"new\\\" into #target'>go</button>"
  :action "find('button').dispatchEvent('click')"
  :check "toHaveText(\"new\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))"))))
