summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-10-30 11:46:40 +0800
committereltrac <hi@eltr.ac>2026-10-30 11:46:40 +0800
commita5f0d0dc9e73ba46a4ff974a256de770d70ac788 (patch)
tree814f8d59a3dd1c76716fe181ad07f8e8ec4cb03f /test
parentdd4c7ca7850f166af4997912a3ded5639bd14a56 (diff)
test, webhook: tidy up webhook; add tests
- (send-webhook) does not need to validate URLs; (trigger) already does that; replace validation logic with :pre conditional - (make-request) does not need to fallback to empty string when event-key is nil. it should never be nil.
Diffstat (limited to 'test')
-rw-r--r--test/weepinbell/webhook_test.clj4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/weepinbell/webhook_test.clj b/test/weepinbell/webhook_test.clj
index 593e709..f7530cc 100644
--- a/test/weepinbell/webhook_test.clj
+++ b/test/weepinbell/webhook_test.clj
@@ -89,7 +89,9 @@
(testing "Webhook constructing request options with custom functions"
(let [custom-map {:body "customized!"}]
(is (= (webhook/make-request :on-receive test-wm-data (fn [& _] custom-map))
- custom-map)))))
+ custom-map))))
+ (testing "Unknown request-fn type"
+ (is (nil? (webhook/make-request :on-delete test-wm-data "I am a function")))))
(deftest make-actions-test
(testing "Constructing action map"