瀏覽代碼

fix(e2e): startup warning notification

Andelf 3 年之前
父節點
當前提交
a790146804
共有 1 個文件被更改,包括 7 次插入6 次删除
  1. 7 6
      src/main/frontend/modules/file/core.cljs

+ 7 - 6
src/main/frontend/modules/file/core.cljs

@@ -131,12 +131,13 @@
   (let [page-block (db/pull (:db/id page-block))
         new-content (tree->file-content tree {:init-level init-level})
         file-db-id (-> page-block :block/file :db/id)
-        file-path (-> (db-utils/entity file-db-id) :file/path)
-        _ (assert (string? file-path) "File path should satisfy string?")
-        ;; FIXME: name conflicts between multiple graphs
-        files [[file-path new-content]]
-        repo (state/get-current-repo)]
-    (file-handler/alter-files-handler! repo files {} {})))
+        file-path (-> (db-utils/entity file-db-id) :file/path)]
+    (if (and (string? file-path) (not-empty file-path))
+      (let [files [[file-path new-content]]
+            repo (state/get-current-repo)]
+        (file-handler/alter-files-handler! repo files {} {}))
+      ;; In e2e tests, "card" page in db has no :file/path
+      (js/console.error "File path from page-block is not valid" page-block tree))))
 
 (defn save-tree
   [page-block tree]