Browse Source

Fix deftests that have confusing args that only apply to defn

Follow up to #8412 where we're accidentally copying
invalid forms from other tests
Gabriel Horner 2 years ago
parent
commit
78506f22d0

+ 0 - 5
deps/graph-parser/test/logseq/graph_parser/extract_test.cljs

@@ -17,7 +17,6 @@
   (-> (extract/extract file text {}) :pages first :block/properties :title))
   (-> (extract/extract file text {}) :pages first :block/properties :title))
 
 
 (deftest extract-blocks-for-headings
 (deftest extract-blocks-for-headings
-  []
   (is (= ["a" "b" "c"]
   (is (= ["a" "b" "c"]
          (extract
          (extract
           "- a
           "- a
@@ -45,7 +44,6 @@
 - j"))))
 - j"))))
 
 
 (deftest parse-page-title
 (deftest parse-page-title
-  []
   (is (= nil
   (is (= nil
          (extract-title "foo.org" "")))
          (extract-title "foo.org" "")))
   (is (= "Howdy"
   (is (= "Howdy"
@@ -67,7 +65,6 @@
 )
 )
 
 
 (deftest extract-blocks-with-property-pages-config
 (deftest extract-blocks-with-property-pages-config
-  []
   (are [extract-args expected-refs]
   (are [extract-args expected-refs]
        (= expected-refs
        (= expected-refs
           (->> (apply extract/extract extract-args)
           (->> (apply extract/extract extract-args)
@@ -82,7 +79,6 @@
        #{"bar" "bing"}))
        #{"bar" "bing"}))
 
 
 (deftest test-regression-1902
 (deftest test-regression-1902
-  []
   (is (= ["line1" "line2" "line3" "line4"]
   (is (= ["line1" "line2" "line3" "line4"]
          (extract
          (extract
           "- line1
           "- line1
@@ -103,7 +99,6 @@
       :block/properties {:title "my whiteboard foo"}})})
       :block/properties {:title "my whiteboard foo"}})})
 
 
 (deftest test-extract-whiteboard-edn
 (deftest test-extract-whiteboard-edn
-  []
   (let [{:keys [pages blocks]} (extract/extract-whiteboard-edn "/whiteboards/foo.edn" (pr-str foo-edn) {})
   (let [{:keys [pages blocks]} (extract/extract-whiteboard-edn "/whiteboards/foo.edn" (pr-str foo-edn) {})
         page (first pages)]
         page (first pages)]
     (is (= (get-in page [:block/file :file/path]) "/whiteboards/foo.edn"))
     (is (= (get-in page [:block/file :file/path]) "/whiteboards/foo.edn"))

+ 0 - 1
deps/graph-parser/test/logseq/graph_parser/mldoc_test.cljs

@@ -106,7 +106,6 @@
        second))
        second))
 
 
 (deftest org-properties-test
 (deftest org-properties-test
-  []
   (testing "just title"
   (testing "just title"
     (let [content "#+TITLE:   some title   "
     (let [content "#+TITLE:   some title   "
           props (parse-properties content)]
           props (parse-properties content)]

+ 0 - 3
deps/graph-parser/test/logseq/graph_parser/text_test.cljs

@@ -4,7 +4,6 @@
             [logseq.graph-parser.mldoc :as gp-mldoc]))
             [logseq.graph-parser.mldoc :as gp-mldoc]))
 
 
 (deftest test-get-page-name
 (deftest test-get-page-name
-  []
   (are [x y] (= (text/get-page-name x) y)
   (are [x y] (= (text/get-page-name x) y)
          "[[page]]" "page"
          "[[page]]" "page"
          "[[another page]]" "another page"
          "[[another page]]" "another page"
@@ -28,7 +27,6 @@
          "[logseq/page](file:./pages/logseq.page.md)" "logseq/page"))
          "[logseq/page](file:./pages/logseq.page.md)" "logseq/page"))
 
 
 (deftest page-ref-un-brackets!
 (deftest page-ref-un-brackets!
-  []
   (are [x y] (= (text/page-ref-un-brackets! x) y)
   (are [x y] (= (text/page-ref-un-brackets! x) y)
     "[[page]]" "page"
     "[[page]]" "page"
     "[[another page]]" "another page"
     "[[another page]]" "another page"
@@ -41,7 +39,6 @@
    :org "*"})
    :org "*"})
 
 
 (deftest remove-level-spaces
 (deftest remove-level-spaces
-  []
   (testing "markdown"
   (testing "markdown"
     (are [x y] (= (text/remove-level-spaces x :markdown (block-patterns :markdown) true) y)
     (are [x y] (= (text/remove-level-spaces x :markdown (block-patterns :markdown) true) y)
       "- foobar" "foobar"
       "- foobar" "foobar"

+ 0 - 1
deps/graph-parser/test/logseq/graph_parser/util/page_ref_test.cljs

@@ -3,7 +3,6 @@
             [cljs.test :refer [are deftest]]))
             [cljs.test :refer [are deftest]]))
 
 
 (deftest page-ref?
 (deftest page-ref?
-  []
   (are [x y] (= (page-ref/page-ref? x) y)
   (are [x y] (= (page-ref/page-ref? x) y)
        "[[page]]" true
        "[[page]]" true
        "[[another page]]" true
        "[[another page]]" true

+ 2 - 6
src/test/frontend/util/text_test.cljs

@@ -3,7 +3,6 @@
             [frontend.util.text :as text-util]))
             [frontend.util.text :as text-util]))
 
 
 (deftest test-add-timestamp
 (deftest test-add-timestamp
-  []
   (are [x y] (= x y)
   (are [x y] (= x y)
     (text-util/add-timestamp "LATER hello world\nhello"
     (text-util/add-timestamp "LATER hello world\nhello"
                         "scheduled"
                         "scheduled"
@@ -21,7 +20,6 @@
     "LATER hello world\nSCHEDULED: <2021-08-25 Wed>\nfoo:: bar\ntest"))
     "LATER hello world\nSCHEDULED: <2021-08-25 Wed>\nfoo:: bar\ntest"))
 
 
 (deftest get-string-all-indexes
 (deftest get-string-all-indexes
-  []
   (are [x y] (= x y)
   (are [x y] (= x y)
     (text-util/get-string-all-indexes "[[hello]] [[world]]" "[[" {})
     (text-util/get-string-all-indexes "[[hello]] [[world]]" "[[" {})
     [0 10]
     [0 10]
@@ -31,7 +29,7 @@
 
 
     (text-util/get-string-all-indexes "a.c a.c ab" "a." {})
     (text-util/get-string-all-indexes "a.c a.c ab" "a." {})
     [0 4]
     [0 4]
-    
+
     (text-util/get-string-all-indexes "abc" "" { :before? true })
     (text-util/get-string-all-indexes "abc" "" { :before? true })
     [0]
     [0]
 
 
@@ -40,7 +38,6 @@
     ))
     ))
 
 
 (deftest test-wrapped-by
 (deftest test-wrapped-by
-  []
   (are [x y] (= x y)
   (are [x y] (= x y)
     '(false false true false false)
     '(false false true false false)
     (map #(text-util/wrapped-by? "[[]]" % "[[" "]]") (take 5 (range)))
     (map #(text-util/wrapped-by? "[[]]" % "[[" "]]") (take 5 (range)))
@@ -60,7 +57,6 @@
 
 
 
 
 (deftest test-cut-by
 (deftest test-cut-by
-  []
   (are [x y] (= x y)
   (are [x y] (= x y)
     ["" "" ""]
     ["" "" ""]
     (text-util/cut-by "[[]]" "[[" "]]")
     (text-util/cut-by "[[]]" "[[" "]]")
@@ -88,6 +84,6 @@
 
 
     ["" "content" ""]
     ["" "content" ""]
     (text-util/cut-by "$pfts>$content$pfts<$" "$pfts>$" "$pfts<$")
     (text-util/cut-by "$pfts>$content$pfts<$" "$pfts>$" "$pfts<$")
-    
+
     ["" "content$p" nil]
     ["" "content$p" nil]
     (text-util/cut-by "$pfts>$content$p" "$pfts>$" "$pfts<$")))
     (text-util/cut-by "$pfts>$content$p" "$pfts>$" "$pfts<$")))