;; Page test specs — declarative assertions for individual pages.
;; The smoke test runner reads page-test-specs via eval and applies
;; them alongside universal smoke checks.

(define page-test-specs {})

(define add-page-test (fn (url spec) (dict-set! page-test-specs url spec)))

(add-page-test "/sx/" {:has-island (list "layouts/header") :has-text (list "Geography" "Language" "Applications" "Etc")})

(add-page-test "/sx/(geography)" {:has-text (list "Reactive Islands" "Hypermedia Lakes" "CEK Machine")})
(add-page-test "/sx/(geography.(reactive))" {:has-text (list "Examples")})
(add-page-test "/sx/(geography.(hypermedia))" {:has-text (list "Reference" "Examples")})
(add-page-test "/sx/(geography.(scopes))" {:has-text (list "scope")})
(add-page-test "/sx/(geography.(provide))" {:has-text (list "provide")})
(add-page-test "/sx/(geography.(marshes))" {:has-text (list "Hypermedia Feeds")})
(add-page-test "/sx/(geography.(cek))" {:has-text (list "CEK")})

(add-page-test "/sx/(geography.(reactive.(examples.counter)))" {:has-island (list "reactive-islands/index/demo-counter")})
(add-page-test "/sx/(geography.(reactive.(examples.temperature)))" {:has-island (list "reactive-islands/index/demo-temperature")})
(add-page-test "/sx/(geography.(reactive.(examples.stopwatch)))" {:has-island (list "reactive-islands/index/demo-stopwatch")})

(add-page-test
  "/sx/(geography.(hypermedia.(example.click-to-load)))"
  {:has-text (list "Click to Load")})
(add-page-test
  "/sx/(geography.(hypermedia.(example.form-submission)))"
  {:has-text (list "Form")})
(add-page-test "/sx/(geography.(hypermedia.(example.polling)))" {:has-text (list "Polling")})

(add-page-test "/sx/(language)" {:has-text (list "Docs" "Specs" "Bootstrappers" "Testing")})
(add-page-test "/sx/(language.(doc.introduction))" {:has-text (list "sx is an s-expression")})
(add-page-test "/sx/(language.(doc.components))" {:has-text (list "defcomp")})
(add-page-test "/sx/(language.(doc.evaluator))" {:has-text (list "eval")})
(add-page-test "/sx/(language.(doc.special-forms))" {:has-text (list "if" "when" "cond" "let")})
(add-page-test "/sx/(language.(spec))" {:has-text (list "Core" "Parser" "Evaluator")})
(add-page-test "/sx/(language.(test))" {:has-text (list "Overview" "Evaluator" "Parser")})

(add-page-test "/sx/(applications)" {:has-text (list "CSSX" "Protocols")})
(add-page-test "/sx/(applications.(cssx))" {:has-text (list "CSS")})
(add-page-test "/sx/(applications.(protocol))" {:has-text (list "Wire Format" "Fragments")})
(add-page-test "/sx/(applications.(hyperscript))" {:has-text (list "hyperscript")})

(add-page-test "/sx/(etc)" {:has-text (list "Essays" "Philosophy" "Plans")})
(add-page-test "/sx/(etc.(essay.why-sexps))" {:has-text (list "S-Expressions")})
(add-page-test "/sx/(etc.(essay.htmx-react-hybrid))" {:has-text (list "htmx")})
(add-page-test "/sx/(etc.(essay.continuations))" {:has-text (list "continuation")})
(add-page-test "/sx/(etc.(philosophy.sx-manifesto))" {:has-text (list "Manifesto")})
(add-page-test "/sx/(etc.(philosophy.wittgenstein))" {:has-text (list "Wittgenstein")})
(add-page-test "/sx/(etc.(plan))" {:has-text (list "Status")})
