-
Notifications
You must be signed in to change notification settings - Fork 0
Storage Examples
Brandon Correa edited this page May 17, 2024
·
1 revision
(ns acme.mimic)
(defn set-theme! [theme]
(js-invoke js/localStorage "setItem" "theme" theme))
(ns acme.mimic-spec
(:require [acme.mimic :as sut]
[bwa.mimic.spec-helper :as spec-helper]
[speclj.core :refer-macros [describe it should=]]))
(describe "Mimic"
(spec-helper/with-memory-local-storage)
(it "sets the theme to light or dark mode"
(sut/set-theme! "light")
(should= "light" (js-invoke js/localStorage "getItem" "theme"))
(sut/set-theme! "dark")
(should= "dark" (js-invoke js/localStorage "getItem" "theme")))
)