Skip to content
Snippets Groups Projects
Commit ab6e5493 authored by Ryan Senior's avatar Ryan Senior
Browse files

Grab the visualization settings from the first result for the goal value

parent de09a2e8
Branches
Tags
No related merge requests found
......@@ -171,11 +171,12 @@
(first-question-name pulse)
(get alert-notification-condition-text condition-kwd))
email-recipients (filterv u/is-email? (map :email recipients))
timezone (-> results first :card defaulted-timezone)]
first-result (first results)
timezone (-> first-result :card defaulted-timezone)]
{:subject email-subject
:recipients email-recipients
:message-type :attachments
:message (messages/render-alert-email timezone pulse results (ui/find-goal-value results))}))
:message (messages/render-alert-email timezone pulse results (ui/find-goal-value first-result))}))
(defmethod create-notification [:alert :slack]
[pulse results {{channel-id :channel} :details :as channel}]
......
......@@ -262,6 +262,7 @@
2
true
true
true
true]
(test-setup
(let [[result & no-more-results] (send-pulse! (retrieve-pulse-or-alert pulse-id))]
......@@ -270,7 +271,8 @@
(count (:message result))
(email-body? (first (:message result)))
(attachment? (second (:message result)))
(goal-above-email-body? (first (:message result)))])))
(goal-above-email-body? (first (:message result)))
(boolean (re-find #"has reached its goal of 5.9" (:content (first (:message result)))))])))
;; Above goal alert, with no data above goal
(tt/expect-with-temp [Card [{card-id :id} (merge (checkins-query {:filter ["between",["field-id" (data/id :checkins :date)],"2014-02-01" "2014-04-01"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment