X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Femoji_test.exs;h=b360475786e4b68a5f94d947959a028c2f3ebb45;hb=b5aa204eb8bf3f737d3d807a9924c0153d1b6d3e;hp=32a828cc975010ad88f9feb4e935f5a6680d877f;hpb=cef2e980b1f6b07c2bdb01030559aca83257bd7e;p=akkoma
diff --git a/test/emoji_test.exs b/test/emoji_test.exs
index 32a828cc9..b36047578 100644
--- a/test/emoji_test.exs
+++ b/test/emoji_test.exs
@@ -1,11 +1,19 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
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()
@@ -14,9 +22,9 @@ defmodule Pleroma.EmojiTest do
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_list(tags)
@@ -24,9 +32,9 @@ defmodule Pleroma.EmojiTest do
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_list(tags)