refactor: allow a block to have multiple types

For example, a whiteboard page can be used both as a property and a class.
This commit is contained in:
Tienson Qin
2023-09-25 10:46:00 +08:00
parent e7423f93ac
commit 0e8653985d
20 changed files with 92 additions and 112 deletions

View File

@@ -103,6 +103,6 @@
page (first pages)]
(is (= (get-in page [:block/file :file/path]) "/whiteboards/foo.edn"))
(is (= (:block/name page) "foo"))
(is (= (:block/type page) "whiteboard"))
(is (true? (contains? (:block/type page) "whiteboard")))
(is (= (:block/original-name page) "Foo"))
(is (every? #(= (:block/parent %) {:block/name "foo"}) blocks))))

View File

@@ -95,7 +95,7 @@
parent (:block/page (ffirst blocks))]
(is (= {:block/name "foo"
:block/original-name "Foo"
:block/type "whiteboard"
:block/type #{"whiteboard"}
:block/file {:file/path "/whiteboards/foo.edn"}}
parent)
"parsed block in the whiteboard page has correct parent page"))))