2019-04-01 06:17:57 -04:00
|
|
|
defmodule Pleroma.EmojiTest do
|
|
|
|
use ExUnit.Case, async: true
|
|
|
|
alias Pleroma.Emoji
|
|
|
|
|
|
|
|
describe "get_all/0" do
|
|
|
|
setup do
|
|
|
|
emoji_list = Emoji.get_all()
|
|
|
|
{:ok, emoji_list: emoji_list}
|
|
|
|
end
|
2019-04-01 06:54:30 -04:00
|
|
|
|
2019-04-01 06:17:57 -04:00
|
|
|
test "first emoji", %{emoji_list: emoji_list} do
|
|
|
|
[emoji | _others] = emoji_list
|
|
|
|
{code, path, tags} = emoji
|
|
|
|
|
|
|
|
assert tuple_size(emoji) == 3
|
|
|
|
assert is_binary(code)
|
|
|
|
assert is_binary(path)
|
|
|
|
assert is_binary(tags)
|
|
|
|
end
|
|
|
|
|
|
|
|
test "random emoji", %{emoji_list: emoji_list} do
|
|
|
|
emoji = Enum.random(emoji_list)
|
2019-04-01 06:54:30 -04:00
|
|
|
{code, path, tags} = emoji
|
2019-04-01 06:17:57 -04:00
|
|
|
|
|
|
|
assert tuple_size(emoji) == 3
|
|
|
|
assert is_binary(code)
|
|
|
|
assert is_binary(path)
|
|
|
|
assert is_binary(tags)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|