From ae762ab9449ee67518738b3d2b7ca2e9fc619e64 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Tue, 14 May 2024 12:16:06 -0400 Subject: [PATCH] fix: unit test and keyword typo --- src/main/frontend/components/property/value.cljs | 2 +- .../frontend/handler/db_based/property_test.cljs | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/frontend/components/property/value.cljs b/src/main/frontend/components/property/value.cljs index 269cd3a29..61d9369a1 100644 --- a/src/main/frontend/components/property/value.cljs +++ b/src/main/frontend/components/property/value.cljs @@ -434,7 +434,7 @@ (:block/original-name e)) :value value}) {:label value - :vaue value}))) + :value value}))) (distinct))) items (->> (if (= :date type) (map (fn [m] (let [label (:block/original-name (db/entity (:value m)))] diff --git a/src/test/frontend/handler/db_based/property_test.cljs b/src/test/frontend/handler/db_based/property_test.cljs index f6913377a..742e3964f 100644 --- a/src/test/frontend/handler/db_based/property_test.cljs +++ b/src/test/frontend/handler/db_based/property_test.cljs @@ -301,20 +301,18 @@ (is (= result :value-exists)))) (testing "Add new value" - (let [{:keys [block-id tx-data]} (outliner-property/upsert-closed-value! conn (:db/id property) {:value 3})] - (db/transact! tx-data) - (let [b (db/entity [:block/uuid block-id])] - (is (= "3" (:block/content b))) - (is (contains? (:block/type b) "closed value")) + (let [_ (outliner-property/upsert-closed-value! conn (:db/id property) {:value 3})] + (let [b (first (d/q '[:find [(pull ?b [*]) ...] :where [?b :block/content "3"]] @conn))] + (is (contains? (set (:block/type b)) "closed value")) (let [values (get-value-ids k)] (is (= #{"1" "2" "3"} (get-closed-values values)))) (testing "Update closed value" - (let [{:keys [tx-data]} (outliner-property/upsert-closed-value! conn (:db/id property) {:id block-id - :value 4 - :description "choice 4"})] - (db/transact! tx-data) + (let [block-id (:block/uuid b) + _ (outliner-property/upsert-closed-value! conn (:db/id property) {:id block-id + :value 4 + :description "choice 4"})] (let [b (db/entity [:block/uuid block-id])] (is (= "4" (:block/content b))) (is (= "choice 4" (:description (:block/schema b))))