diff options
author | lambda <lain@soykaf.club> | 2019-04-08 09:50:00 +0000 |
---|---|---|
committer | lambda <lain@soykaf.club> | 2019-04-08 09:50:00 +0000 |
commit | 23067908de957bb1e7ad2c87e64ae91e4328cb87 (patch) | |
tree | 2c75327c2b35d5759eb971d5486a7f30bef8d386 /test/web | |
parent | b177e1e7f330ff1531be190949db7f75e378a449 (diff) | |
parent | 7410aee886fbb38615bb595b8b7be0722761a0a4 (diff) | |
download | pleroma-23067908de957bb1e7ad2c87e64ae91e4328cb87.tar.gz |
Merge branch 'feature/770-add-emoji-tags' into 'develop'
Feature/770 add emoji tags
See merge request pleroma/pleroma!998
Diffstat (limited to 'test/web')
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 16 | ||||
-rw-r--r-- | test/web/twitter_api/util_controller_test.exs | 21 |
2 files changed, 37 insertions, 0 deletions
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index cd01116e2..e16862a48 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -2342,6 +2342,22 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do assert acc_two == acc_three end + describe "custom emoji" do + test "with tags", %{conn: conn} do + [emoji | _body] = + conn + |> get("/api/v1/custom_emojis") + |> json_response(200) + + assert Map.has_key?(emoji, "shortcode") + assert Map.has_key?(emoji, "static_url") + assert Map.has_key?(emoji, "tags") + assert is_list(emoji["tags"]) + assert Map.has_key?(emoji, "url") + assert Map.has_key?(emoji, "visible_in_picker") + end + end + describe "index/2 redirections" do setup %{conn: conn} do session_opts = [ diff --git a/test/web/twitter_api/util_controller_test.exs b/test/web/twitter_api/util_controller_test.exs index e4dd97d46..410f20f87 100644 --- a/test/web/twitter_api/util_controller_test.exs +++ b/test/web/twitter_api/util_controller_test.exs @@ -170,6 +170,27 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do end end + describe "/api/pleroma/emoji" do + test "returns json with custom emoji with tags", %{conn: conn} do + [emoji | _body] = + conn + |> get("/api/pleroma/emoji") + |> json_response(200) + + [key] = Map.keys(emoji) + + %{ + ^key => %{ + "image_url" => url, + "tags" => tags + } + } = emoji + + assert is_binary(url) + assert is_list(tags) + end + end + describe "GET /ostatus_subscribe?acct=...." do test "adds status to pleroma instance if the `acct` is a status", %{conn: conn} do conn = |