|
|
@@ -3,6 +3,7 @@
|
|
|
[clojure.test :refer [deftest testing is use-fixtures]]
|
|
|
[logseq.e2e.fixtures :as fixtures]
|
|
|
[logseq.e2e.keyboard :as k]
|
|
|
+ [logseq.e2e.block :as b]
|
|
|
[logseq.e2e.util :as util]
|
|
|
[wally.main :as w]))
|
|
|
|
|
|
@@ -12,19 +13,19 @@
|
|
|
(util/new-page "p1")
|
|
|
;; a page block and a child block
|
|
|
(is (= 2 (util/blocks-count)))
|
|
|
- (util/new-blocks ["first block" "second block"])
|
|
|
+ (b/new-blocks ["first block" "second block"])
|
|
|
(util/exit-edit)
|
|
|
(is (= 3 (util/blocks-count))))
|
|
|
|
|
|
(deftest indent-and-outdent-test
|
|
|
(util/new-page "p2")
|
|
|
- (util/new-blocks ["b1" "b2"])
|
|
|
+ (b/new-blocks ["b1" "b2"])
|
|
|
(testing "simple indent and outdent"
|
|
|
(util/indent)
|
|
|
(util/outdent))
|
|
|
|
|
|
(testing "indent a block with its children"
|
|
|
- (util/new-block "b3")
|
|
|
+ (b/new-block "b3")
|
|
|
(util/indent)
|
|
|
(k/arrow-up)
|
|
|
(util/indent)
|
|
|
@@ -33,8 +34,8 @@
|
|
|
(is (< x1 x2 x3))))
|
|
|
|
|
|
(testing "unindent a block with its children"
|
|
|
- (util/open-last-block)
|
|
|
- (util/new-blocks ["b4" "b5"])
|
|
|
+ (b/open-last-block)
|
|
|
+ (b/new-blocks ["b4" "b5"])
|
|
|
(util/indent)
|
|
|
(k/arrow-up)
|
|
|
(util/outdent)
|
|
|
@@ -44,7 +45,7 @@
|
|
|
|
|
|
(deftest move-up-down-test
|
|
|
(util/new-page "p3")
|
|
|
- (util/new-blocks ["b1" "b2" "b3" "b4"])
|
|
|
+ (b/new-blocks ["b1" "b2" "b3" "b4"])
|
|
|
(util/repeat-keyboard 2 "Shift+ArrowUp")
|
|
|
(let [contents (util/get-page-blocks-contents)]
|
|
|
(is (= contents ["b1" "b2" "b3" "b4"])))
|
|
|
@@ -58,20 +59,20 @@
|
|
|
(deftest delete-test
|
|
|
(testing "Delete blocks case 1"
|
|
|
(util/new-page "p4")
|
|
|
- (util/new-blocks ["b1" "b2" "b3" "b4"])
|
|
|
- (util/delete-blocks) ; delete b4
|
|
|
+ (b/new-blocks ["b1" "b2" "b3" "b4"])
|
|
|
+ (b/delete-blocks) ; delete b4
|
|
|
(util/repeat-keyboard 2 "Shift+ArrowUp") ; select b3 and b2
|
|
|
- (util/delete-blocks)
|
|
|
+ (b/delete-blocks)
|
|
|
(is (= "b1" (util/get-edit-content)))
|
|
|
(is (= 1 (util/page-blocks-count))))
|
|
|
|
|
|
(testing "Delete block with its children"
|
|
|
(util/new-page "p5")
|
|
|
- (util/new-blocks ["b1" "b2" "b3" "b4"])
|
|
|
+ (b/new-blocks ["b1" "b2" "b3" "b4"])
|
|
|
(util/indent)
|
|
|
(k/arrow-up)
|
|
|
(util/indent)
|
|
|
(k/arrow-up)
|
|
|
- (util/delete-blocks)
|
|
|
+ (b/delete-blocks)
|
|
|
(is (= "b1" (util/get-edit-content)))
|
|
|
(is (= 1 (util/page-blocks-count)))))
|