forked from AkkomaGang/akkoma
code style
little fix
This commit is contained in:
parent
3601f03147
commit
17d3d05a71
3 changed files with 9 additions and 5 deletions
|
@ -152,7 +152,7 @@ defp load do
|
|||
"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}
|
||||
|
@ -193,14 +193,14 @@ defp load_from_file_stream(stream) do
|
|||
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")
|
||||
|
|
|
@ -7,6 +7,7 @@ defmodule Pleroma.EmojiTest do
|
|||
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
|
||||
|
@ -19,7 +20,7 @@ test "first emoji", %{emoji_list: emoji_list} do
|
|||
|
||||
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)
|
||||
|
|
|
@ -272,7 +272,10 @@ test "it returns the emoji used in the text" do
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue