aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThurloat <thurloat@gmail.com>2018-08-31 14:28:39 -0300
committerThurloat <thurloat@gmail.com>2018-08-31 14:29:23 -0300
commita9c0f395cb4d854e552a3205cb5b38ff610f8e27 (patch)
treea26788d664485f200e2573ee8447e8e84a270ddb /test
parentd31bbb1cfe04ca6073a322bcf77239e7d4b79839 (diff)
downloadpleroma-a9c0f395cb4d854e552a3205cb5b38ff610f8e27.tar.gz
add nil clause for Formatter.get_emoji/1 to return an empty result
Diffstat (limited to 'test')
-rw-r--r--test/formatter_test.exs10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/formatter_test.exs b/test/formatter_test.exs
index 95558089b..4e27efe06 100644
--- a/test/formatter_test.exs
+++ b/test/formatter_test.exs
@@ -199,4 +199,14 @@ defmodule Pleroma.FormatterTest do
assert Formatter.get_emoji(text) == [{"moominmamma", "/finmoji/128px/moominmamma-128.png"}]
end
+
+ test "it returns a nice empty result when no emojis are present" do
+ text = "I love moominamma"
+ assert Formatter.get_emoji(text) == []
+ end
+
+ test "it doesn't die when text is absent" do
+ text = nil
+ assert Formatter.get_emoji(text) == []
+ end
end