first commit
This commit is contained in:
commit
5b16dd6774
24 files changed
+9575
No files matched your search
@@ -0,0 +1,42 @@
|
||||
(ns website.core-spec
|
||||
(:require-macros [speclj.core :refer [describe it should= should should-not]])
|
||||
(:require [speclj.core]
|
||||
[reagent.core :as reagent :refer [atom]]
|
||||
[website.core :as rc]))
|
||||
|
||||
|
||||
(def isClient (not (nil? (try (.-document js/window)
|
||||
(catch js/Object e nil)))))
|
||||
|
||||
(def rflush reagent/flush)
|
||||
|
||||
(defn add-test-div [name]
|
||||
(let [doc js/document
|
||||
body (.-body js/document)
|
||||
div (.createElement doc "div")]
|
||||
(.appendChild body div)
|
||||
div))
|
||||
|
||||
(defn with-mounted-component [comp f]
|
||||
(when isClient
|
||||
(let [div (add-test-div "_testreagent")]
|
||||
(let [comp (reagent/render-component comp div #(f comp div))]
|
||||
(reagent/unmount-component-at-node div)
|
||||
(reagent/flush)
|
||||
(.removeChild (.-body js/document) div)))))
|
||||
|
||||
|
||||
(defn found-in [re div]
|
||||
(let [res (.-innerHTML div)]
|
||||
(if (re-find re res)
|
||||
true
|
||||
(do (println "Not found: " res)
|
||||
false))))
|
||||
|
||||
|
||||
(describe "test home"
|
||||
(it "contains 'Welcome to' in home page"
|
||||
(with-mounted-component (rc/home-page)
|
||||
(fn [c div]
|
||||
(should (found-in #"Welcome to" div))))))
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
(ns website.tobbar)
|
||||
|
||||
|
||||
;<nav class="navbar" role="navigation" aria-label="main navigation">
|
||||
;<div class="navbar-brand">
|
||||
;<!-- navbar items, navbar burger... -->
|
||||
;</div>
|
||||
;</nav>
|
||||
|
||||
(defn top-bar []
|
||||
[:nav.navbar {:role "navigation" :aria-label "main navigation"}
|
||||
[:div.navbar-brand
|
||||
[:a.navbar-item {:href "https://bulma.io"}
|
||||
[:img {:href "https://bulma.io/images/bulma-logo.png"}]]]])
|
||||
Reference in new issue
Block a user