|
|
@@ -27,13 +27,13 @@
|
|
|
:block/parent 10002
|
|
|
:block/title "4"}])
|
|
|
|
|
|
- (is (= (:content (bean/->clj (api-block/get_block 10000 #js {}))) "1"))
|
|
|
- (is (= (:content (bean/->clj (api-block/get_block "d9b7b45f-267f-4794-9569-f43d1ce77172" #js {}))) "2"))
|
|
|
- (is (= (:content (bean/->clj (api-block/get_block #uuid "d9b7b45f-267f-4794-9569-f43d1ce77172" #js {}))) "2"))
|
|
|
- (is (= {:id 10001, :content "2", :uuid "d9b7b45f-267f-4794-9569-f43d1ce77172", :children [["uuid" "adae3006-f03e-4814-a1f5-f17f15b86556"]]}
|
|
|
+ (is (= (:title (bean/->clj (api-block/get_block 10000 #js {}))) "1"))
|
|
|
+ (is (= (:title (bean/->clj (api-block/get_block "d9b7b45f-267f-4794-9569-f43d1ce77172" #js {}))) "2"))
|
|
|
+ (is (= (:title (bean/->clj (api-block/get_block #uuid "d9b7b45f-267f-4794-9569-f43d1ce77172" #js {}))) "2"))
|
|
|
+ (is (= {:id 10001, :title "2", :uuid "d9b7b45f-267f-4794-9569-f43d1ce77172", :children [["uuid" "adae3006-f03e-4814-a1f5-f17f15b86556"]]}
|
|
|
(select-keys (js->clj (api-block/get_block 10001 #js {:includeChildren false}) :keywordize-keys true)
|
|
|
- [:id :content :uuid :children])))
|
|
|
- (is (= {:content "2", :uuid "d9b7b45f-267f-4794-9569-f43d1ce77172", :id 10001, :children [{:content "3", :parent {:id 10001}, :uuid "adae3006-f03e-4814-a1f5-f17f15b86556", :id 10002, :level 1, :children [{:content "4", :parent {:id 10002}, :uuid "0c3053c3-2dab-4769-badd-14ce16d8ba8d", :id 10003, :level 2, :children []}]}]}
|
|
|
+ [:id :title :uuid :children])))
|
|
|
+ (is (= {:title "2", :uuid "d9b7b45f-267f-4794-9569-f43d1ce77172", :id 10001, :children [{:title "3", :parent {:id 10001}, :uuid "adae3006-f03e-4814-a1f5-f17f15b86556", :id 10002, :level 1, :children [{:title "4", :parent {:id 10002}, :uuid "0c3053c3-2dab-4769-badd-14ce16d8ba8d", :id 10003, :level 2, :children []}]}]}
|
|
|
(js->clj (api-block/get_block 10001 #js {:includeChildren true}) :keywordize-keys true)))))
|
|
|
|
|
|
#_(cljs.test/run-tests)
|