;; 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: default (9 tests — 0 runnable)"
    (p :style "color:#57534e;margin-bottom:1rem" "Live cards for the upstream default tests. 0 of 9 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-expressions))"
        :style "color:#7c3aed" "expressions"))
    (div :style "display:flex;flex-direction:column"
      (~hyperscript/hs-test-card
  :name "can default possessive properties"
  :html "<div id='d1' _=\\\"on click default #d1's foo to 'bar' then put #d1's foo into me\\\"></div>"
  :action "find('#d1').dispatchEvent('click')"
  :check "toHaveText(\"bar\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "can default of-expression properties"
  :html "<div id='d1' _=\\\"on click default foo of me to 'bar' then put my foo into me\\\"></div>"
  :action "find('#d1').dispatchEvent('click')"
  :check "toHaveText(\"bar\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "can default array elements"
  :html "<div _=\"on click set arr to [null, null] then default arr[0] to 'yes' then put arr[0] into me\"></div>"
  :action "find('div').dispatchEvent('click')"
  :check "toHaveText(\"yes\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "default array element respects existing value"
  :html "<div _=\"on click set arr to ['existing', null] then default arr[0] to 'new' then put arr[0] into me\"></div>"
  :action "find('div').dispatchEvent('click')"
  :check "toHaveText(\"existing\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "default preserves zero"
  :html "<div _='on click set x to 0 then default x to 10 then put x 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 "default overwrites empty string"
  :html "<div _='on click set x to \"\" then default x to \"fallback\" then put x into me'></div>"
  :action "find('div').dispatchEvent('click')"
  :check "toHaveText(\"fallback\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "default preserves false"
  :html "<div _='on click set x to false then default x to true then put x into me'></div>"
  :action "find('div').dispatchEvent('click')"
  :check "toHaveText(\"false\")"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "can default style ref when unset"
  :html "<div _=\"on click default *background-color to 'red'\"></div>"
  :action "find('div').dispatchEvent('click')"
  :check "toHaveCSS('background-color', 'rgb(255, 0, 0)"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))")
(~hyperscript/hs-test-card
  :name "default style ref preserves existing value"
  :html "<div style=\"color: blue\" _=\"on click default *color to 'red'\"></div>"
  :action "find('div').dispatchEvent('click')"
  :check "toHaveCSS('color', 'rgb(0, 0, 255)"
  :run-src "(fn (sandbox) (error \"not yet runnable in gallery — see test suite\"))"))))
