diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-05-11 09:53:25 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-05-11 09:53:25 +0200 |
commit | c7779e8e8ad172be64aa98ee62a83b54185e3bce (patch) | |
tree | 3cbc9138471768ac9ff0c51b53df20acc5cc6949 /test | |
parent | ebb44f398037c3bd6aca1c85799ed353c44e9c3d (diff) | |
parent | b19390cd38ba93e527e5961723b46779749f1ee1 (diff) |
Merge branch 'audit' into develop
Diffstat (limited to 'test')
-rw-r--r-- | test/mastodon-profile-tests.el | 76 |
1 files changed, 38 insertions, 38 deletions
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<p>Developer of Mastodon and administrator of mastodon.social. I post service announcements, development updates, and personal stuff.</p>\n")) + (should + (equal + (buffer-substring-no-properties (point-min) (point-max)) + "\n Eugen (@Gargron)\n<p>Developer of Mastodon and administrator of mastodon.social. I post service announcements, development updates, and personal stuff.</p>\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. |