2019-07-10 07:13:23 +02:00
|
|
|
# Pleroma: A lightweight social networking server
|
|
|
|
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2019-04-01 12:17:57 +02: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 12:54:30 +02:00
|
|
|
|
2019-04-01 12:17:57 +02:00
|
|
|
test "first emoji", %{emoji_list: emoji_list} do
|
|
|
|
[emoji | _others] = emoji_list
|
2019-08-29 05:22:18 +02:00
|
|
|
{code, path, tags, _, _} = emoji
|
2019-04-01 12:17:57 +02:00
|
|
|
|
2019-08-29 05:22:18 +02:00
|
|
|
assert tuple_size(emoji) == 5
|
2019-04-01 12:17:57 +02:00
|
|
|
assert is_binary(code)
|
|
|
|
assert is_binary(path)
|
2019-04-18 20:17:52 +02:00
|
|
|
assert is_list(tags)
|
2019-04-01 12:17:57 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
test "random emoji", %{emoji_list: emoji_list} do
|
|
|
|
emoji = Enum.random(emoji_list)
|
2019-08-29 05:22:18 +02:00
|
|
|
{code, path, tags, _, _} = emoji
|
2019-04-01 12:17:57 +02:00
|
|
|
|
2019-08-29 05:22:18 +02:00
|
|
|
assert tuple_size(emoji) == 5
|
2019-04-01 12:17:57 +02:00
|
|
|
assert is_binary(code)
|
|
|
|
assert is_binary(path)
|
2019-04-18 20:17:52 +02:00
|
|
|
assert is_list(tags)
|
2019-04-01 12:17:57 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|