;; 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: halt (7 tests — 0 runnable)"
    (p :style "color:#57534e;margin-bottom:1rem" "Live cards for the upstream halt tests. 0 of 7 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-events))"
        :style "color:#7c3aed" "events"))
    (div :style "display:flex;flex-direction:column"
      (~hyperscript/hs-test-card
  :name "halts event propagation and default"
  :html "<div id='outer' _='on click add .outer-clicked'>  <a id='inner' href='#shouldnot' _='on click halt'>click me</a></div>"
  :action "find('#inner').dispatchEvent('click')"
  :check "toHaveClass(/outer-clicked/)"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "halt stops execution after the halt"
  :html "<div _='on click halt then add .should-not-happen'>test</div>"
  :action "find('div').dispatchEvent('click')"
  :check "toHaveClass(/should-not-happen/)"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "halt the event stops propagation but continues execution"
  :html "<div id='outer' _='on click add .outer-clicked'>  <div id='inner' _='on click halt the event then add .continued'>click me</div></div>"
  :action "find('#inner').dispatchEvent('click')"
  :check "toHaveClass(/outer-clicked/); toHaveClass(/continued/)"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "halt the event's stops propagation but continues execution"
  :html "<div id='outer' _='on click add .outer-clicked'>  <div id='inner' _=\\\"on click halt the event's then add .continued\\\">click me</div></div>"
  :action "find('#inner').dispatchEvent('click')"
  :check "toHaveClass(/outer-clicked/); toHaveClass(/continued/)"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "halt bubbling only stops propagation, not default"
  :html "<div id='outer' _='on click add .outer-clicked'>  <div id='inner' _='on click halt bubbling then add .continued'>click me</div></div>"
  :action "find('#inner').dispatchEvent('click')"
  :check "toHaveClass(/outer-clicked/); toHaveClass(/continued/)"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "halt works outside of event context"
  :html ""
  :action ""
  :check ""
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "halt default only prevents default, not propagation"
  :html "<div id='outer' _='on click add .outer-clicked'>  <div id='inner' _='on click halt default'>click me</div></div>"
  :action "find('#inner').dispatchEvent('click')"
  :check "toHaveClass(/outer-clicked/)"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))"))))
