mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
✨ Update telemetry task for handle user subscriptions
This commit is contained in:
@@ -21,13 +21,16 @@
|
||||
(with-mocks [mock {:target 'app.tasks.telemetry/send!
|
||||
:return nil}]
|
||||
(let [task-fn (-> th/*system* :app.worker/registry :telemetry)
|
||||
prof (th/create-profile* 1 {:is-active true})]
|
||||
prof (th/create-profile* 1 {:is-active true
|
||||
:props {:newsletter-subscribed true}})]
|
||||
|
||||
;; run the task
|
||||
(task-fn nil)
|
||||
(task-fn {:send? true :enabled? true})
|
||||
|
||||
(t/is (:called? @mock))
|
||||
(let [[_ data] (-> @mock :call-args)]
|
||||
(t/is (contains? data :subscriptions))
|
||||
(t/is (= [(:email prof)] (get data :subscriptions)))
|
||||
(t/is (contains? data :total-fonts))
|
||||
(t/is (contains? data :total-users))
|
||||
(t/is (contains? data :total-projects))
|
||||
|
||||
Reference in New Issue
Block a user