projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Transmogrifier: Extract user update handling tests.
[akkoma]
/
test
/
web
/
activity_pub
/
object_validators
/
types
/
safe_text_test.exs
diff --git
a/test/web/activity_pub/object_validators/types/safe_text_test.exs
b/test/web/activity_pub/object_validators/types/safe_text_test.exs
index 59ed0a1febbc675744d6f3045b12f78266f44304..d4a574554b03c3389b4f57b5980064174f6a4d11 100644
(file)
--- a/
test/web/activity_pub/object_validators/types/safe_text_test.exs
+++ b/
test/web/activity_pub/object_validators/types/safe_text_test.exs
@@
-17,6
+17,13
@@
defmodule Pleroma.Web.ActivityPub.ObjectValidators.Types.SafeTextTest do
assert {:ok, "hey look xss alert('foo')"} == SafeText.cast(text)
end
assert {:ok, "hey look xss alert('foo')"} == SafeText.cast(text)
end
+ test "it keeps basic html tags" do
+ text = "hey <a href='http://gensokyo.2hu'>look</a> xss <script>alert('foo')</script>"
+
+ assert {:ok, "hey <a href=\"http://gensokyo.2hu\">look</a> xss alert('foo')"} ==
+ SafeText.cast(text)
+ end
+
test "errors for non-text" do
assert :error == SafeText.cast(1)
end
test "errors for non-text" do
assert :error == SafeText.cast(1)
end