From f3298f6d51b78cd904f144d54f3b229a7bb70c6b Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 8 May 2023 19:59:03 +0200 Subject: rename profile--add-author-bylines to profile--format-user --- test/mastodon-profile-tests.el | 76 +++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 38 deletions(-) (limited to 'test') diff --git a/test/mastodon-profile-tests.el b/test/mastodon-profile-tests.el index 56cb852..1936b99 100644 --- a/test/mastodon-profile-tests.el +++ b/test/mastodon-profile-tests.el @@ -122,48 +122,48 @@ When formatting Gargon's state we want to see - the url of the avatar (yet to be loaded) - the info attached to the name" (with-mock - ;; Don't start any image loading: - (mock (mastodon-media--inline-images * *) => nil) - ;; Let's not do formatting as that makes it hard to not rely on - ;; window width and reflowing the text. - (mock (shr-render-region * *) => nil) - (if (version< emacs-version "27.1") - (mock (image-type-available-p 'imagemagick) => t) - (mock (image-transforms-p) => t)) + ;; Don't start any image loading: + (mock (mastodon-media--inline-images * *) => nil) + ;; Let's not do formatting as that makes it hard to not rely on + ;; window width and reflowing the text. + (mock (shr-render-region * *) => nil) + (if (version< emacs-version "27.1") + (mock (image-type-available-p 'imagemagick) => t) + (mock (image-transforms-p) => t)) - (with-temp-buffer - (let ((mastodon-tl--show-avatars t) - (mastodon-tl--display-media-p t)) - (mastodon-profile--add-author-bylines (list gargron-profile-json))) + (with-temp-buffer + (let ((mastodon-tl--show-avatars t) + (mastodon-tl--display-media-p t)) + (mastodon-profile--format-user (list gargron-profile-json))) - (should - (equal - (buffer-substring-no-properties (point-min) (point-max)) - "\n Eugen (@Gargron)\n

Developer of Mastodon and administrator of mastodon.social. I post service announcements, development updates, and personal stuff.

\n")) + (should + (equal + (buffer-substring-no-properties (point-min) (point-max)) + "\n Eugen (@Gargron)\n

Developer of Mastodon and administrator of mastodon.social. I post service announcements, development updates, and personal stuff.

\n")) - ;; Check the avatar at pos 2 - (should - (equal - (get-text-property 2 'media-url) - "https://files.mastodon.social/accounts/avatars/000/000/001/original/d96d39a0abb45b92.jpg")) - (should - (equal - (get-text-property 2 'media-state) - 'needs-loading)) + ;; Check the avatar at pos 2 + (should + (equal + (get-text-property 2 'media-url) + "https://files.mastodon.social/accounts/avatars/000/000/001/original/d96d39a0abb45b92.jpg")) + (should + (equal + (get-text-property 2 'media-state) + 'needs-loading)) - ;; Check the byline state - (should - (equal - (get-text-property 4 'byline) - t)) - (should - (equal - (get-text-property 4 'toot-id) - (alist-get 'id gargron-profile-json))) - (should - (equal - (get-text-property 4 'toot-json) - gargron-profile-json))))) + ;; Check the byline state + (should + (equal + (get-text-property 4 'byline) + t)) + (should + (equal + (get-text-property 4 'toot-id) + (alist-get 'id gargron-profile-json))) + (should + (equal + (get-text-property 4 'toot-json) + gargron-profile-json))))) (ert-deftest mastodon-profile--search-account-by-handle--removes-at () "Should ignore a leading at-sign in user handle. -- cgit v1.2.3