mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
test(e2e,rtc): fix new-block to make it work correctly in rtc env
This commit is contained in:
@@ -16,7 +16,8 @@
|
||||
[logseq.e2e.property-basic-test]
|
||||
[logseq.e2e.util :as util]
|
||||
[wally.main :as w]
|
||||
[wally.repl :as repl]))
|
||||
[wally.repl :as repl]
|
||||
[logseq.e2e.locator :as loc]))
|
||||
|
||||
;; Use port 3001 for local testing
|
||||
(reset! config/*port 3001)
|
||||
|
||||
@@ -22,14 +22,18 @@
|
||||
|
||||
(defn new-block
|
||||
[title]
|
||||
(let [editor (util/get-editor)
|
||||
blocks-count (util/blocks-count)]
|
||||
(let [editor (util/get-editor)]
|
||||
(when-not editor (open-last-block))
|
||||
(assert/assert-editor-mode)
|
||||
(k/enter)
|
||||
(assert/assert-have-count ".ls-block" (inc blocks-count))
|
||||
(assert/assert-editor-mode)
|
||||
(save-block title)))
|
||||
(let [last-id (.getAttribute (w/-query ".editor-wrapper textarea") "id")]
|
||||
(is (some? last-id))
|
||||
(k/enter)
|
||||
(assert/assert-is-visible
|
||||
(loc/filter ".editor-wrapper"
|
||||
:has "textarea"
|
||||
:has-not (str "#" last-id)))
|
||||
(assert/assert-editor-mode)
|
||||
(save-block title))))
|
||||
|
||||
;; TODO: support tree
|
||||
(defn new-blocks
|
||||
@@ -38,7 +42,7 @@
|
||||
(when-not editor? (open-last-block))
|
||||
(assert/assert-editor-mode)
|
||||
(let [value (util/get-edit-content)]
|
||||
(if (string/blank? value) ; empty block
|
||||
(if (string/blank? value) ; empty block
|
||||
(save-block (first titles))
|
||||
(new-block (first titles))))
|
||||
(doseq [title (rest titles)]
|
||||
|
||||
Reference in New Issue
Block a user