;; Page test for /sx/(geography.(isomorphism.streaming))
;;
;; The streaming page sends an HTML shell immediately with suspense
;; skeletons, then resolves three slots at staggered delays (1s, 3s, 5s).
;; Single navigation test — streaming pages block the server during IO,
;; so multiple navigations in one suite would queue.

(defsuite
  "streaming-demo"
  :url "/sx/(geography.(isomorphism.streaming))"
  :stream true
  :timeout 60000
  (deftest
    "streaming page renders and resolves"
    (wait-for "h1" :text "Streaming" :timeout 30000)
    (assert-count "[data-suspense]" 3 :timeout 30000)
    (wait-for
      "[data-suspense='stream-fast']"
      :text "Fast source"
      :timeout 30000)
    (wait-for
      "[data-suspense='stream-medium']"
      :text "Medium source"
      :timeout 30000)
    (wait-for
      "[data-suspense='stream-slow']"
      :text "Slow source"
      :timeout 30000)
    (wait-for "[data-suspense='stream-fast']" :text "~1s" :timeout 5000)
    (wait-for "[data-suspense='stream-medium']" :text "~3s" :timeout 5000)
    (wait-for "[data-suspense='stream-slow']" :text "~5s" :timeout 5000)))
