aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-08-05 20:57:54 +0200
committermarty hiatt <martianhiatus@riseup.net>2024-08-05 20:59:04 +0200
commitc45cb5edf3ba9f8c4f494942a29c8ccee401617c (patch)
tree1b5cbbd7a9796313082ebadee24617741c58d65c /test
parent5bbfebc92d6ff8e66e3072c453f6c3a44129cab2 (diff)
fix profile search account tests
Diffstat (limited to 'test')
-rw-r--r--test/mastodon-profile-tests.el25
1 files changed, 13 insertions, 12 deletions
diff --git a/test/mastodon-profile-tests.el b/test/mastodon-profile-tests.el
index be7f50e..e0431b4 100644
--- a/test/mastodon-profile-tests.el
+++ b/test/mastodon-profile-tests.el
@@ -23,12 +23,12 @@
(statuses_count . 70741)
(last_status_at . "2021-11-14")
(emojis . [])
- (fields . [((name . "Patreon")
+ (fields . (((name . "Patreon")
(value . "<a href=\"https://www.patreon.com/mastodon\" rel=\"me nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://www.</span><span class=\"\">patreon.com/mastodon</span><span class=\"invisible\"></span></a>")
(verified_at))
((name . "Homepage")
(value . "<a href=\"https://zeonfederated.com\" rel=\"me nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://</span><span class=\"\">zeonfederated.com</span><span class=\"invisible\"></span></a>")
- (verified_at . "2019-07-15T18:29:57.191+00:00"))])))
+ (verified_at . "2019-07-15T18:29:57.191+00:00"))))))
(defconst ccc-profile-json
'((id . "369027")
@@ -105,10 +105,10 @@
(website))
(account ,@gargron-profile-json)
(media_attachments . [])
- (mentions . [((id . "369027")
+ (mentions . (((id . "369027")
(username . "CCC")
(url . "https://social.bau-ha.us/@CCC")
- (acct . "CCC@social.bau-ha.us"))])
+ (acct . "CCC@social.bau-ha.us"))))
(tags . [])
(emojis . [])
(card)
@@ -183,11 +183,10 @@ The search will happen as if called without the \"@\"."
"Should ignore results that don't match the searched handle."
(with-mock
(mock (mastodon-http--get-json
- "https://instance.url/api/v1/accounts/search"
- '(("q" . "Gargron")))
- =>
- (vector ccc-profile-json gargron-profile-json))
-
+ "https://instance.url/api/v2/search"
+ '(("q" . "Gargron")
+ ("type" . "accounts")))
+ => `((accounts ,ccc-profile-json ,gargron-profile-json)))
(let ((mastodon-instance-url "https://instance.url"))
(should
(equal
@@ -199,9 +198,11 @@ The search will happen as if called without the \"@\"."
TODO: We need to decide if this is actually desired or not."
(with-mock
- (mock (mastodon-http--get-json *
- '(("q" . "gargron")))
- => (vector gargron-profile-json))
+ (mock (mastodon-http--get-json
+ "https://instance.url/api/v2/search"
+ '(("q" . "gargron")
+ ("type" . "accounts")))
+ => `((accounts ,ccc-profile-json ,gargron-profile-json)))
(let ((mastodon-instance-url "https://instance.url"))
(should