mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
add marker_test & priority_test
This commit is contained in:
26
src/test/frontend/util/marker_test.cljs
Normal file
26
src/test/frontend/util/marker_test.cljs
Normal file
@@ -0,0 +1,26 @@
|
||||
(ns frontend.util.marker_test
|
||||
(:require [cljs.test :refer [deftest is are testing]]
|
||||
[frontend.util.marker :as marker]))
|
||||
|
||||
(deftest add-or-update-marker-markdown
|
||||
(are [content marker expect] (= expect (marker/add-or-update-marker content :markdown marker))
|
||||
"test content" "TODO" "TODO test content"
|
||||
"\nxxx\n" "TODO" "TODO xxx\n"
|
||||
"## xxx" "TODO" "## TODO xxx"
|
||||
"## [#A] xxx" "TODO" "## TODO [#A] xxx"
|
||||
"" "TODO" "TODO "
|
||||
"todo" "TODO" "TODO todo"
|
||||
"TODO xxx" "DONE" "DONE xxx"
|
||||
"TODO" "DONE" "DONE "
|
||||
"## TODO [#A] xxx" "DONE" "## DONE [#A] xxx"))
|
||||
|
||||
(deftest add-or-update-marker-org
|
||||
(are [content marker expect] (= expect (marker/add-or-update-marker content :org marker))
|
||||
"test content" "TODO" "TODO test content"
|
||||
"\nxxx\n" "TODO" "TODO xxx\n"
|
||||
"" "TODO" "TODO "
|
||||
"todo" "TODO" "TODO todo"
|
||||
"TODO xxx" "DONE" "DONE xxx"
|
||||
"TODO" "DONE" "DONE "))
|
||||
|
||||
#_(cljs.test/run-tests)
|
||||
21
src/test/frontend/util/priority_test.cljs
Normal file
21
src/test/frontend/util/priority_test.cljs
Normal file
@@ -0,0 +1,21 @@
|
||||
(ns frontend.util.priority_test
|
||||
(:require [cljs.test :refer [deftest is are testing]]
|
||||
[frontend.util.priority :as priority]))
|
||||
|
||||
(deftest add-or-update-priority-markdown
|
||||
(are [content priority expect] (= expect (priority/add-or-update-priority content :markdown priority))
|
||||
"test content" "[#A]" "[#A] test content"
|
||||
"" "[#A]" "[#A] "
|
||||
"[#A] xxx" "[#B]" "[#B] xxx"
|
||||
"## xxx" "[#A]" "## [#A] xxx"
|
||||
"## TODO xxx" "[#A]" "## TODO [#A] xxx"
|
||||
"## TODO [#B] xxx" "[#A]" "## TODO [#A] xxx"
|
||||
))
|
||||
|
||||
(deftest add-or-update-marker-org
|
||||
(are [content priority expect] (= expect (priority/add-or-update-priority content :org priority))
|
||||
"test content" "[#A]" "[#A] test content"
|
||||
"" "[#A]" "[#A] "
|
||||
"[#A] xxx" "[#B]" "[#B] xxx"))
|
||||
|
||||
#_(cljs.test/run-tests)
|
||||
Reference in New Issue
Block a user