浏览代码

Add status and priority commands e2e tests

Tienson Qin 5 月之前
父节点
当前提交
e3e3df1315
共有 1 个文件被更改,包括 25 次插入0 次删除
  1. 25 0
      clj-e2e/test/logseq/e2e/commands_test.clj

+ 25 - 0
clj-e2e/test/logseq/e2e/commands_test.clj

@@ -120,3 +120,28 @@
         (is (= text (util/get-edit-content)))
         (util/exit-edit)
         (w/wait-for heading)))))
+
+(deftest status-test
+  (testing "task status commands"
+    (let [status->icon {"Doing" "InProgress50"
+                        "In review" "InReview"
+                        "Canceled" "Cancelled"}]
+      (doseq [status ["Backlog" "Todo" "Doing" "In review" "Done" "Canceled"]]
+        (let [text (str status " test ")]
+          (b/new-block text)
+          (input-command status)
+          (is (= text (util/get-edit-content)))
+          (util/exit-edit)
+          (w/wait-for (str ".ls-icon-" (get status->icon status status))))))))
+
+(deftest priority-test
+  (testing "task priority commands"
+    (let [priority->icon {"No priority" "line-dashed"}]
+      (doseq [priority ["No priority" "Low" "Medium" "High" "Urgent"]]
+        (let [text (str priority " test ")]
+          (b/new-block text)
+          (input-command priority)
+          (is (= text (util/get-edit-content)))
+          (util/exit-edit)
+          (w/wait-for (str ".ls-icon-" (get priority->icon priority
+                                            (str "priorityLvl" priority)))))))))