asset_sync_effects_test.cljs 1.0 KB

123456789101112131415161718192021222324
  1. (ns frontend.worker.rtc.asset-sync-effects-test
  2. "This ns include tests abouts asset-sync with other components.
  3. These tests need to start the asset-sync-loop."
  4. #_:clj-kondo/ignore
  5. (:require [clojure.test :as t :refer [deftest is use-fixtures]]
  6. [frontend.test.helper :include-macros true :as test-helper]
  7. [frontend.worker.rtc.fixture :as rtc-fixture]
  8. #_:clj-kondo/ignore
  9. [spy.core :as spy]))
  10. (use-fixtures :each
  11. test-helper/start-and-destroy-db-map-fixture
  12. rtc-fixture/listen-test-db-fixture
  13. rtc-fixture/start-and-stop-asset-sync-loop-fixture
  14. rtc-fixture/clear-op-mem-stores-fixture)
  15. ;; FIXME: Re-enable when this test doesn't fail when whole test suite is run
  16. ;; e.g. https://github.com/logseq/logseq/actions/runs/7627378707/job/20775904183
  17. #_(deftest asset-sync-loop-init-test
  18. (let [ws @(:*ws @rtc-fixture/*test-asset-sync-state)
  19. handler-fn (:handler-fn ws)
  20. ws-msg (first (spy/last-call handler-fn))]
  21. (is (= "list-graphs" (:action ws-msg)))))