;; 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: reset (8 tests — 0 runnable)"
    (p :style "color:#57534e;margin-bottom:1rem" "Live cards for the upstream reset 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-dom))"
        :style "color:#7c3aed" "dom"))
    (div :style "display:flex;flex-direction:column"
      (~hyperscript/hs-test-card
  :name "can reset a form"
  :html "
			<form id=\"f1\">
				<input type=\"text\" id=\"t1\" value=\"original\" />
				<button type=\"button\" _=\"on click set #t1's value to 'changed'\">Change</button>
				<button type=\"button\" id=\"rst\" _=\"on click reset #f1\">Reset</button>
			</form>
		"
  :action "find('#t1').fill('changed'); find('#rst').dispatchEvent('click')"
  :check "toHaveValue('changed'); toHaveValue('original')"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "reset with no target resets me (form)"
  :html "
			<form _=\"on custom reset\">
				<input type=\"text\" id=\"t2\" value=\"default\" />
			</form>
		"
  :action "find('#t2').fill('modified'); find('form').dispatchEvent('custom')"
  :check "toHaveValue('modified'); toHaveValue('default')"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "can reset a text input to defaultValue"
  :html "
			<input type=\"text\" id=\"t3\" value=\"hello\" />
			<button _=\"on click reset #t3\">Reset</button>
		"
  :action "find('#t3').fill('goodbye'); find('button').dispatchEvent('click')"
  :check "toHaveValue('goodbye'); toHaveValue('hello')"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "can reset a checkbox"
  :html "
			<input type=\"checkbox\" id=\"cb1\" checked />
			<button _=\"on click reset #cb1\">Reset</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 reset an unchecked checkbox"
  :html "
			<input type=\"checkbox\" id=\"cb2\" />
			<button _=\"on click reset #cb2\">Reset</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 reset a textarea"
  :html "
			<textarea id=\"ta1\">original text</textarea>
			<button _=\"on click reset #ta1\">Reset</button>
		"
  :action "find('#ta1').fill('new text'); find('button').dispatchEvent('click')"
  :check "toHaveValue('new text'); toHaveValue('original text')"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "can reset a select"
  :html "
			<select id=\"sel1\">
				<option value=\"a\">A</option>
				<option value=\"b\" selected>B</option>
				<option value=\"c\">C</option>
			</select>
			<button _=\"on click reset #sel1\">Reset</button>
		"
  :action "find('button').dispatchEvent('click')"
  :check "toHaveValue('c'); toHaveValue('b')"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "can reset multiple inputs"
  :html "
			<input type=\"text\" class=\"resettable\" value=\"one\" />
			<input type=\"text\" class=\"resettable\" value=\"two\" />
			<button _=\"on click reset .resettable\">Reset</button>
		"
  :action "find('button').dispatchEvent('click')"
  :check ""
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))"))))
