"woollysocks"
]
defp load_finmoji(true) do
- tag = Keyword.get(Application.get_env(:pleroma, :emoji), :finmoji_tag)
+ tag = Application.get_env(:pleroma, :emoji)[:finmoji_tag]
Enum.map(@finmoji, fn finmoji ->
{finmoji, "/finmoji/128px/#{finmoji}-128.png", tag}
end
@spec get_default_tag(String.t()) :: String.t()
- defp get_default_tag(file_name) when file_name in ["emoji", "custom_emojii"] do
+ defp get_default_tag(file_name) when file_name in ["emoji", "custom_emoji"] do
Keyword.get(
Application.get_env(:pleroma, :emoji),
String.to_existing_atom(file_name <> "_tag")
)
end
- defp get_default_tag(_), do: Keyword.get(Application.get_env(:pleroma, :emoji), :custom_tag)
+ defp get_default_tag(_), do: Application.get_env(:pleroma, :emoji)[:custom_tag]
defp load_from_globs(globs) do
static_path = Path.join(:code.priv_dir(:pleroma), "static")
emoji_list = Emoji.get_all()
{:ok, emoji_list: emoji_list}
end
+
test "first emoji", %{emoji_list: emoji_list} do
[emoji | _others] = emoji_list
{code, path, tags} = emoji
test "random emoji", %{emoji_list: emoji_list} do
emoji = Enum.random(emoji_list)
- {code, path, tags} = emoji
+ {code, path, tags} = emoji
assert tuple_size(emoji) == 3
assert is_binary(code)
text = "I love :moominmamma:"
tag = Keyword.get(Application.get_env(:pleroma, :emoji), :finmoji_tag)
- assert Formatter.get_emoji(text) == [{"moominmamma", "/finmoji/128px/moominmamma-128.png", tag}]
+
+ assert Formatter.get_emoji(text) == [
+ {"moominmamma", "/finmoji/128px/moominmamma-128.png", tag}
+ ]
end
test "it returns a nice empty result when no emojis are present" do