test(rtc): add ut case for update-remote-data-by-local-unpushed-ops-test

feat/tables
rcmerci 2024-06-26 16:05:34 +08:00
parent a42ac9ce30
commit 4d56ae039e
1 changed files with 19 additions and 1 deletions

View File

@ -62,7 +62,25 @@
unpushed-ops
[[:move 1 {:block-uuid uuid1}]]
r (#'r.remote/update-remote-data-by-local-unpushed-ops affected-blocks-map unpushed-ops)]
(is (empty? r)))))
(is (empty? r))))
(testing "case4: update remote :update-attrs op"
(let [[uuid1 uuid2] (repeatedly random-uuid)
affected-blocks-map
{uuid1
{:op :update-attrs
:self uuid1
:parents [uuid2]
:block/order "a0"
:block/content "update content"}}
unpushed-ops
[[:move 1 {:block-uuid uuid1}]]
r (#'r.remote/update-remote-data-by-local-unpushed-ops affected-blocks-map unpushed-ops)]
(is (= {uuid1
{:op :update-attrs
:self uuid1
:block/content "update content"}}
r)))))
(deftest gen-remote-ops-test
(let [repo (state/get-current-repo)