;; 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: empty (13 tests — 0 runnable)"
    (p :style "color:#57534e;margin-bottom:1rem" "Live cards for the upstream empty tests. 0 of 13 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-dom))"
        :style "color:#7c3aed" "dom"))
    (div :style "display:flex;flex-direction:column"
      (~hyperscript/hs-test-card
  :name "can empty an element"
  :html "<div id='d1'><p>hello</p><p>world</p></div><button _='on click empty #d1'></button>"
  :action "find('button').dispatchEvent('click')"
  :check "toHaveText(\"helloworld\"); toHaveText(\"\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "empty with no target empties me"
  :html "<div _='on click empty'>content</div>"
  :action "find('div').dispatchEvent('click')"
  :check "toHaveText(\"content\"); toHaveText(\"\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "can empty multiple elements"
  :html "<div class='clearme'><p>a</p></div><div class='clearme'><p>b</p></div><button _='on click empty .clearme'></button>"
  :action "find('button').dispatchEvent('click')"
  :check ""
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "can empty an array"
  :html "<div _=\"on click
		                      set :arr to [1,2,3]
		                      empty :arr
		                      put :arr.length into me\"></div>"
  :action "find('div').dispatchEvent('click')"
  :check "toHaveText(\"0\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "can empty a set"
  :html "<div _=\"on click
		                      set :s to [1,2,3] as Set
		                      empty :s
		                      put :s.size into me\"></div>"
  :action "find('div').dispatchEvent('click')"
  :check "toHaveText(\"0\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "can empty a map"
  :html "<div _=\"on click
		                      set :m to {a:1, b:2} as Map
		                      empty :m
		                      put :m.size into me\"></div>"
  :action "find('div').dispatchEvent('click')"
  :check "toHaveText(\"0\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "can empty a text input"
  :html "
			<input type=\"text\" id=\"t1\" value=\"hello\" />
			<button _=\"on click empty #t1\">Empty</button>
		"
  :action "find('button').dispatchEvent('click')"
  :check "toHaveValue(\"hello\"); toHaveValue(\"\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "can empty a textarea"
  :html "
			<textarea id=\"ta1\">some text</textarea>
			<button _=\"on click empty #ta1\">Empty</button>
		"
  :action "find('button').dispatchEvent('click')"
  :check "toHaveValue(\"\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "can empty a checkbox"
  :html "
			<input type=\"checkbox\" id=\"cb1\" checked />
			<button _=\"on click empty #cb1\">Empty</button>
		"
  :action "find('button').dispatchEvent('click')"
  :check ""
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "can empty a select"
  :html "
			<select id=\"sel1\">
				<option value=\"a\">A</option>
				<option value=\"b\" selected>B</option>
			</select>
			<button _=\"on click empty #sel1\">Empty</button>
		"
  :action "find('button').dispatchEvent('click')"
  :check "toBe(-1)"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "can empty a form (clears all inputs)"
  :html "
			<form id=\"f1\">
				<input type=\"text\" id=\"t2\" value=\"val\" />
				<textarea id=\"ta2\">text</textarea>
				<input type=\"checkbox\" id=\"cb2\" checked />
			</form>
			<button _=\"on click empty #f1\">Empty</button>
		"
  :action "find('button').dispatchEvent('click')"
  :check "toHaveValue(\"\"); toHaveValue(\"\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "clear is an alias for empty"
  :html "
			<input type=\"text\" id=\"t3\" value=\"hello\" />
			<button _=\"on click clear #t3\">Clear</button>
		"
  :action "find('button').dispatchEvent('click')"
  :check "toHaveValue(\"hello\"); toHaveValue(\"\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "clear works on elements"
  :html "<div id='d2'><p>content</p></div><button _='on click clear #d2'></button>"
  :action "find('button').dispatchEvent('click')"
  :check "toHaveText(\"content\"); toHaveText(\"\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))"))))
