[#1260] Merge remote-tracking branch 'remotes/upstream/develop' into 1260-rate-limite...
[akkoma] / test / emoji_test.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.EmojiTest do
6 use ExUnit.Case, async: true
7 alias Pleroma.Emoji
8
9 describe "get_all/0" do
10 setup do
11 emoji_list = Emoji.get_all()
12 {:ok, emoji_list: emoji_list}
13 end
14
15 test "first emoji", %{emoji_list: emoji_list} do
16 [emoji | _others] = emoji_list
17 {code, %Emoji{file: path, tags: tags}} = emoji
18
19 assert tuple_size(emoji) == 2
20 assert is_binary(code)
21 assert is_binary(path)
22 assert is_list(tags)
23 end
24
25 test "random emoji", %{emoji_list: emoji_list} do
26 emoji = Enum.random(emoji_list)
27 {code, %Emoji{file: path, tags: tags}} = emoji
28
29 assert tuple_size(emoji) == 2
30 assert is_binary(code)
31 assert is_binary(path)
32 assert is_list(tags)
33 end
34 end
35 end