diff options
| author | Maksim Pechnikov <parallel588@gmail.com> | 2020-02-10 07:59:52 +0300 |
|---|---|---|
| committer | Maksim Pechnikov <parallel588@gmail.com> | 2020-02-10 07:59:52 +0300 |
| commit | b87533760bb386e85eb8c806e1d242d2b1380971 (patch) | |
| tree | 5bdd76fba3da0d90a4c81fff6a930f47b15d4f4c /test/web/mastodon_api/views | |
| parent | ba5e8a644463a19b863e862def80adb6a5a1060b (diff) | |
| parent | 544bdbfb90d764a5aba8ed07c13b842838d76d73 (diff) | |
| download | pleroma-b87533760bb386e85eb8c806e1d242d2b1380971.tar.gz pleroma-b87533760bb386e85eb8c806e1d242d2b1380971.zip | |
Merge branch 'develop' into issue/1276
Diffstat (limited to 'test/web/mastodon_api/views')
| -rw-r--r-- | test/web/mastodon_api/views/account_view_test.exs | 4 | ||||
| -rw-r--r-- | test/web/mastodon_api/views/notification_view_test.exs | 2 | ||||
| -rw-r--r-- | test/web/mastodon_api/views/status_view_test.exs | 11 |
3 files changed, 12 insertions, 5 deletions
diff --git a/test/web/mastodon_api/views/account_view_test.exs b/test/web/mastodon_api/views/account_view_test.exs index 2107bb85c..00c294845 100644 --- a/test/web/mastodon_api/views/account_view_test.exs +++ b/test/web/mastodon_api/views/account_view_test.exs @@ -368,10 +368,10 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do assert result.pleroma[:settings_store] == nil end - test "sanitizes display names" do + test "doesn't sanitize display names" do user = insert(:user, name: "<marquee> username </marquee>") result = AccountView.render("show.json", %{user: user}) - refute result.display_name == "<marquee> username </marquee>" + assert result.display_name == "<marquee> username </marquee>" end test "never display nil user follow counts" do diff --git a/test/web/mastodon_api/views/notification_view_test.exs b/test/web/mastodon_api/views/notification_view_test.exs index 1fe83cb2c..2ac75c2ff 100644 --- a/test/web/mastodon_api/views/notification_view_test.exs +++ b/test/web/mastodon_api/views/notification_view_test.exs @@ -135,7 +135,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationViewTest do NotificationView.render("index.json", %{notifications: [notification], for: follower}) end - test "EmojiReaction notification" do + test "EmojiReact notification" do user = insert(:user) other_user = insert(:user) diff --git a/test/web/mastodon_api/views/status_view_test.exs b/test/web/mastodon_api/views/status_view_test.exs index 25777b011..fc110417c 100644 --- a/test/web/mastodon_api/views/status_view_test.exs +++ b/test/web/mastodon_api/views/status_view_test.exs @@ -37,8 +37,15 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do status = StatusView.render("show.json", activity: activity) assert status[:pleroma][:emoji_reactions] == [ - %{emoji: "☕", count: 2}, - %{emoji: "🍵", count: 1} + %{emoji: "☕", count: 2, reacted: false}, + %{emoji: "🍵", count: 1, reacted: false} + ] + + status = StatusView.render("show.json", activity: activity, for: user) + + assert status[:pleroma][:emoji_reactions] == [ + %{emoji: "☕", count: 2, reacted: true}, + %{emoji: "🍵", count: 1, reacted: false} ] end |
