diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-08-11 15:13:29 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-08-11 15:13:29 +0300 |
commit | 2def3cbf417075146da5e54201e9b969e6aa3eca (patch) | |
tree | 93cdf149a1874f56d2808598f8aeee15e60c8a10 /test/web/mastodon_api | |
parent | 56ddf20208657487bf0298409cf91b11dac346ff (diff) | |
parent | 686002164a5ab63ccb22cff015faf87f8f7fc9ec (diff) | |
download | pleroma-2def3cbf417075146da5e54201e9b969e6aa3eca.tar.gz pleroma-2def3cbf417075146da5e54201e9b969e6aa3eca.zip |
Merge remote-tracking branch 'remotes/origin/develop' into 2168-media-preview-proxy
# Conflicts:
# config/config.exs
# mix.lock
Diffstat (limited to 'test/web/mastodon_api')
-rw-r--r-- | test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs | 4 | ||||
-rw-r--r-- | test/web/mastodon_api/views/poll_view_test.exs | 29 |
2 files changed, 33 insertions, 0 deletions
diff --git a/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs b/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs index b888e4c71..2e6704726 100644 --- a/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs +++ b/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs @@ -214,6 +214,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do assert user_data = json_response_and_validate_schema(conn, 200) assert user_data["display_name"] == "markorepairs" + + update_activity = Repo.one(Pleroma.Activity) + assert update_activity.data["type"] == "Update" + assert update_activity.data["object"]["name"] == "markorepairs" end test "updates the user's avatar", %{user: user, conn: conn} do diff --git a/test/web/mastodon_api/views/poll_view_test.exs b/test/web/mastodon_api/views/poll_view_test.exs index 76672f36c..b7e2f17ef 100644 --- a/test/web/mastodon_api/views/poll_view_test.exs +++ b/test/web/mastodon_api/views/poll_view_test.exs @@ -135,4 +135,33 @@ defmodule Pleroma.Web.MastodonAPI.PollViewTest do assert result[:expires_at] == nil assert result[:expired] == false end + + test "doesn't strips HTML tags" do + user = insert(:user) + + {:ok, activity} = + CommonAPI.post(user, %{ + status: "What's with the smug face?", + poll: %{ + options: [ + "<input type=\"date\">", + "<input type=\"date\" >", + "<input type=\"date\"/>", + "<input type=\"date\"></input>" + ], + expires_in: 20 + } + }) + + object = Object.normalize(activity) + + assert %{ + options: [ + %{title: "<input type=\"date\">", votes_count: 0}, + %{title: "<input type=\"date\" >", votes_count: 0}, + %{title: "<input type=\"date\"/>", votes_count: 0}, + %{title: "<input type=\"date\"></input>", votes_count: 0} + ] + } = PollView.render("show.json", %{object: object}) + end end |