projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ChatController: Add GET /chats/:id
[akkoma]
/
test
/
emoji_test.exs
diff --git
a/test/emoji_test.exs
b/test/emoji_test.exs
index c9c32e20b204ee5a4b192346a3e8dc8a1eacdc8e..b360475786e4b68a5f94d947959a028c2f3ebb45 100644
(file)
--- a/
test/emoji_test.exs
+++ b/
test/emoji_test.exs
@@
-1,30
+1,43
@@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.EmojiTest do
use ExUnit.Case, async: true
alias Pleroma.Emoji
defmodule Pleroma.EmojiTest do
use ExUnit.Case, async: true
alias Pleroma.Emoji
+ describe "is_unicode_emoji?/1" do
+ test "tells if a string is an unicode emoji" do
+ refute Emoji.is_unicode_emoji?("X")
+ assert Emoji.is_unicode_emoji?("☂")
+ assert Emoji.is_unicode_emoji?("🥺")
+ end
+ end
+
describe "get_all/0" do
setup do
emoji_list = Emoji.get_all()
{:ok, emoji_list: emoji_list}
end
describe "get_all/0" do
setup do
emoji_list = Emoji.get_all()
{:ok, emoji_list: emoji_list}
end
+
test "first emoji", %{emoji_list: emoji_list} do
[emoji | _others] = emoji_list
test "first emoji", %{emoji_list: emoji_list} do
[emoji | _others] = emoji_list
- {code,
path, tags
} = emoji
+ {code,
%Emoji{file: path, tags: tags}
} = emoji
- assert tuple_size(emoji) ==
3
+ assert tuple_size(emoji) ==
2
assert is_binary(code)
assert is_binary(path)
assert is_binary(code)
assert is_binary(path)
- assert is_
binary
(tags)
+ assert is_
list
(tags)
end
test "random emoji", %{emoji_list: emoji_list} do
emoji = Enum.random(emoji_list)
end
test "random emoji", %{emoji_list: emoji_list} do
emoji = Enum.random(emoji_list)
-
{code, path, tags
} = emoji
+
{code, %Emoji{file: path, tags: tags}
} = emoji
- assert tuple_size(emoji) ==
3
+ assert tuple_size(emoji) ==
2
assert is_binary(code)
assert is_binary(path)
assert is_binary(code)
assert is_binary(path)
- assert is_
binary
(tags)
+ assert is_
list
(tags)
end
end
end
end
end
end