Add Resource Loader SPA and JS test harness
All checks were successful
Build Org Website / build (push) Successful in 38s
All checks were successful
Build Org Website / build (push) Successful in 38s
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
"misc.css"
|
||||
"media.css"
|
||||
"wird-tracker.css"
|
||||
"pages/resource-loader.css"
|
||||
"zhd.css"
|
||||
"play.css"
|
||||
"hidden-details.css")
|
||||
@@ -58,6 +59,8 @@
|
||||
"pages/sitemap-interactive.js"
|
||||
"pages/wird-tracker.js"
|
||||
"pages/home-dashboard.js"
|
||||
"pages/resource-loader-model.js"
|
||||
"pages/resource-loader.js"
|
||||
"pages/play.js"
|
||||
"features/hidden-details.js")
|
||||
"\n")
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
("org-assets"
|
||||
:base-directory ,(site-path "assets/")
|
||||
:base-extension "css\\|js\\|png\\|jpg\\|jpeg\\|gif\\|webp\\|svg\\|pdf\\|mp4\\|webm\\|mov\\|ogg\\|wav\\|woff\\|woff2\\|ttf"
|
||||
:base-extension "css\\|js\\|mjs\\|txt\\|png\\|jpg\\|jpeg\\|gif\\|webp\\|svg\\|pdf\\|mp4\\|webm\\|mov\\|ogg\\|wav\\|woff\\|woff2\\|ttf"
|
||||
:publishing-directory ,(output-path "assets/")
|
||||
:recursive t
|
||||
:publishing-function org-publish-attachment)
|
||||
|
||||
@@ -259,6 +259,32 @@
|
||||
(let* ((info (list :input-file temp-file))
|
||||
(output "\\documentclass{article}")
|
||||
(result (z/org-html-add-body-classes output 'latex info)))
|
||||
(should (string= output result))))))
|
||||
(should (string= output result))))))
|
||||
|
||||
;; ── Resource Loader SPA ─────────────────────────────────────────────────────
|
||||
|
||||
(ert-deftest test/resource-loader-assets-registered ()
|
||||
"The Resource Loader's loaders should be present in the shared head."
|
||||
(should (string-match-p "pages/resource-loader\\.css" z/shared-head))
|
||||
(should (string-match-p "pages/resource-loader-model\\.js" z/shared-head))
|
||||
(should (string-match-p "pages/resource-loader\\.js" z/shared-head)))
|
||||
|
||||
(ert-deftest test/resource-loader-publishes-with-site-shell ()
|
||||
"The /rl source should publish with the normal preamble and postamble."
|
||||
(let ((html
|
||||
(with-temp-buffer
|
||||
(insert-file-contents (site-path "rl/index.org"))
|
||||
(setq-local buffer-file-name (site-path "rl/index.org"))
|
||||
(org-mode)
|
||||
(org-export-as
|
||||
'z-html nil nil nil
|
||||
(list :html-preamble z/preamble
|
||||
:html-postamble z/postamble
|
||||
:html-head z/shared-head
|
||||
:with-toc nil
|
||||
:section-numbers nil)))))
|
||||
(should (string-match-p "id=\"resource-loader\"" html))
|
||||
(should (string-match-p "class=\"banner-header\"" html))
|
||||
(should (string-match-p "<footer>" html))))
|
||||
|
||||
;;; build-site-tests.el ends here
|
||||
|
||||
Reference in New Issue
Block a user