From c45cb5edf3ba9f8c4f494942a29c8ccee401617c Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 5 Aug 2024 20:57:54 +0200 Subject: fix profile search account tests --- test/mastodon-profile-tests.el | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'test/mastodon-profile-tests.el') 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 . "https://www.patreon.com/mastodon") (verified_at)) ((name . "Homepage") (value . "https://zeonfederated.com") - (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 -- cgit v1.2.3