diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/web/mastodon_api/account_view_test.exs | 3 | ||||
-rw-r--r-- | test/web/twitter_api/views/user_view_test.exs | 16 |
2 files changed, 10 insertions, 9 deletions
diff --git a/test/web/mastodon_api/account_view_test.exs b/test/web/mastodon_api/account_view_test.exs index 8bf194e6b..35c8a1fb0 100644 --- a/test/web/mastodon_api/account_view_test.exs +++ b/test/web/mastodon_api/account_view_test.exs @@ -20,6 +20,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do info: %{"note_count" => 5, "follower_count" => 3, "source_data" => source_data}, nickname: "shp@shitposter.club", name: ":karjalanpiirakka: shp", + bio: "<script src=\"invalid-html\"></script><span>valid html</span>", inserted_at: ~N[2017-08-15 15:47:06.597036] }) @@ -33,7 +34,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do followers_count: 3, following_count: 0, statuses_count: 5, - note: user.bio, + note: "<span>valid html</span>", url: user.ap_id, avatar: "http://localhost:4001/images/avi.png", avatar_static: "http://localhost:4001/images/avi.png", diff --git a/test/web/twitter_api/views/user_view_test.exs b/test/web/twitter_api/views/user_view_test.exs index fefb6bdcc..24a5c5bca 100644 --- a/test/web/twitter_api/views/user_view_test.exs +++ b/test/web/twitter_api/views/user_view_test.exs @@ -65,8 +65,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do "name" => user.name, "screen_name" => user.nickname, "name_html" => user.name, - "description" => HtmlSanitizeEx.strip_tags(user.bio), - "description_html" => HtmlSanitizeEx.strip_tags(user.bio), + "description" => HtmlSanitizeEx.strip_tags(user.bio |> String.replace("<br>", "\n")), + "description_html" => HtmlSanitizeEx.basic_html(user.bio), "created_at" => user.inserted_at |> Utils.format_naive_asctime(), "favourites_count" => 0, "statuses_count" => 1, @@ -104,8 +104,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do "name" => user.name, "screen_name" => user.nickname, "name_html" => user.name, - "description" => HtmlSanitizeEx.strip_tags(user.bio), - "description_html" => HtmlSanitizeEx.strip_tags(user.bio), + "description" => HtmlSanitizeEx.strip_tags(user.bio |> String.replace("<br>", "\n")), + "description_html" => HtmlSanitizeEx.basic_html(user.bio), "created_at" => user.inserted_at |> Utils.format_naive_asctime(), "favourites_count" => 0, "statuses_count" => 0, @@ -144,8 +144,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do "name" => follower.name, "screen_name" => follower.nickname, "name_html" => follower.name, - "description" => HtmlSanitizeEx.strip_tags(follower.bio), - "description_html" => HtmlSanitizeEx.strip_tags(follower.bio), + "description" => HtmlSanitizeEx.strip_tags(follower.bio |> String.replace("<br>", "\n")), + "description_html" => HtmlSanitizeEx.basic_html(follower.bio), "created_at" => follower.inserted_at |> Utils.format_naive_asctime(), "favourites_count" => 0, "statuses_count" => 0, @@ -191,8 +191,8 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do "name" => user.name, "screen_name" => user.nickname, "name_html" => user.name, - "description" => HtmlSanitizeEx.strip_tags(user.bio), - "description_html" => HtmlSanitizeEx.strip_tags(user.bio), + "description" => HtmlSanitizeEx.strip_tags(user.bio |> String.replace("<br>", "\n")), + "description_html" => HtmlSanitizeEx.basic_html(user.bio), "created_at" => user.inserted_at |> Utils.format_naive_asctime(), "favourites_count" => 0, "statuses_count" => 0, |