aboutsummaryrefslogtreecommitdiff
path: root/test/mastodon-tl-tests.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-04-21 11:11:13 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-04-21 11:11:13 +0200
commit96fc842db36d138b3d6cbd8d109c61fb6aa2cf6f (patch)
tree6e97af912e96202b2e44e912ab9e2376d6d2bb13 /test/mastodon-tl-tests.el
parentd8149443fafae6131a52443a0c5e333bf114aab2 (diff)
refactor tl--report-build-params and a hack test for it
Diffstat (limited to 'test/mastodon-tl-tests.el')
-rw-r--r--test/mastodon-tl-tests.el42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/mastodon-tl-tests.el b/test/mastodon-tl-tests.el
index f1b4735..5dd6a04 100644
--- a/test/mastodon-tl-tests.el
+++ b/test/mastodon-tl-tests.el
@@ -1155,3 +1155,45 @@ correct value for following, as well as notifications enabled or disabled."
("comment" . "Dummy complaint")
("status_ids[]" . 61208)
("forward" . "true")))))))))
+
+(ert-deftest mastodon-tl--report-build-params ()
+ ""
+ (should (equal
+ (mastodon-tl--report-build-params 42 "Dummy complaint"
+ 61208 "true" nil '(1 2 3))
+ '(("rule_ids[]" . 3)
+ ("rule_ids[]" . 2)
+ ("rule_ids[]" . 1)
+ ("account_id" . 42)
+ ("comment" . "Dummy complaint")
+ ("status_ids[]" . 61208)
+ ("forward" . "true"))))
+ (should (equal
+ (mastodon-tl--report-build-params 42 "Dummy complaint"
+ nil "true" nil nil)
+ '(("account_id" . 42)
+ ("comment" . "Dummy complaint")
+ ("forward" . "true"))))
+ (should (equal
+ (mastodon-tl--report-build-params 42 "Dummy complaint"
+ 61208 "true" "spam" nil)
+ '(("account_id" . 42)
+ ("comment" . "Dummy complaint")
+ ("status_ids[]" . 61208)
+ ("forward" . "true")
+ ("category" . "spam"))))
+ (should (equal
+ (mastodon-tl--report-build-params 42 "Dummy complaint"
+ 61208 "true" "other" nil)
+ '(("account_id" . 42)
+ ("comment" . "Dummy complaint")
+ ("status_ids[]" . 61208)
+ ("forward" . "true")
+ ("category" . "other"))))
+ (should (equal
+ (mastodon-tl--report-build-params 42 "Dummy complaint"
+ 61208 nil "spam" nil)
+ '(("account_id" . 42)
+ ("comment" . "Dummy complaint")
+ ("status_ids[]" . 61208)
+ ("category" . "spam")))))