projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'fix/attachment-cleanup' into 'develop'
[akkoma]
/
test
/
pleroma
/
web
/
push
/
impl_test.exs
diff --git
a/test/pleroma/web/push/impl_test.exs
b/test/pleroma/web/push/impl_test.exs
index 2575c76d670c9cebca72c5d211f6c63c2638e838..b3ca1a3376fab710e21c7b65c46868a803af7014 100644
(file)
--- a/
test/pleroma/web/push/impl_test.exs
+++ b/
test/pleroma/web/push/impl_test.exs
@@
-1,9
+1,9
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-202
0
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-202
1
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Push.ImplTest do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Push.ImplTest do
- use Pleroma.DataCase
+ use Pleroma.DataCase
, async: true
import Pleroma.Factory
import Pleroma.Factory
@@
-118,7
+118,7
@@
defmodule Pleroma.Web.Push.ImplTest do
"<span>Lorem ipsum dolor sit amet</span>, consectetur :firefox: adipiscing elit. Fusce sagittis finibus turpis."
})
"<span>Lorem ipsum dolor sit amet</span>, consectetur :firefox: adipiscing elit. Fusce sagittis finibus turpis."
})
- object = Object.normalize(activity)
+ object = Object.normalize(activity
, fetch: false
)
assert Impl.format_body(
%{
assert Impl.format_body(
%{
@@
-137,7
+137,7
@@
defmodule Pleroma.Web.Push.ImplTest do
user = insert(:user, nickname: "Bob")
other_user = insert(:user)
{:ok, _, _, activity} = CommonAPI.follow(user, other_user)
user = insert(:user, nickname: "Bob")
other_user = insert(:user)
{:ok, _, _, activity} = CommonAPI.follow(user, other_user)
- object = Object.normalize(activity, false)
+ object = Object.normalize(activity, f
etch: f
alse)
assert Impl.format_body(%{activity: activity, type: "follow"}, user, object) ==
"@Bob has followed you"
assert Impl.format_body(%{activity: activity, type: "follow"}, user, object) ==
"@Bob has followed you"
@@
-156,7
+156,7
@@
defmodule Pleroma.Web.Push.ImplTest do
})
{:ok, announce_activity} = CommonAPI.repeat(activity.id, user)
})
{:ok, announce_activity} = CommonAPI.repeat(activity.id, user)
- object = Object.normalize(activity)
+ object = Object.normalize(activity
, fetch: false
)
assert Impl.format_body(%{activity: announce_activity}, user, object) ==
"@#{user.nickname} repeated: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sagittis fini..."
assert Impl.format_body(%{activity: announce_activity}, user, object) ==
"@#{user.nickname} repeated: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sagittis fini..."
@@
-175,7
+175,7
@@
defmodule Pleroma.Web.Push.ImplTest do
})
{:ok, activity} = CommonAPI.favorite(user, activity.id)
})
{:ok, activity} = CommonAPI.favorite(user, activity.id)
- object = Object.normalize(activity)
+ object = Object.normalize(activity
, fetch: false
)
assert Impl.format_body(%{activity: activity, type: "favourite"}, user, object) ==
"@Bob has favorited your post"
assert Impl.format_body(%{activity: activity, type: "favourite"}, user, object) ==
"@Bob has favorited your post"
@@
-193,10
+193,10
@@
defmodule Pleroma.Web.Push.ImplTest do
})
{:ok, activity} = CommonAPI.react_with_emoji(activity.id, user, "👍")
})
{:ok, activity} = CommonAPI.react_with_emoji(activity.id, user, "👍")
- object = Object.normalize(activity)
+ object = Object.normalize(activity
, fetch: false
)
assert Impl.format_body(%{activity: activity, type: "pleroma:emoji_reaction"}, user, object) ==
assert Impl.format_body(%{activity: activity, type: "pleroma:emoji_reaction"}, user, object) ==
- "@Bob
has
reacted with 👍"
+ "@Bob reacted with 👍"
assert Impl.format_title(%{activity: activity, type: "pleroma:emoji_reaction"}) ==
"New Reaction"
assert Impl.format_title(%{activity: activity, type: "pleroma:emoji_reaction"}) ==
"New Reaction"
@@
-221,7
+221,7
@@
defmodule Pleroma.Web.Push.ImplTest do
recipient = insert(:user)
{:ok, chat} = CommonAPI.post_chat_message(user, recipient, "hey")
recipient = insert(:user)
{:ok, chat} = CommonAPI.post_chat_message(user, recipient, "hey")
- object = Object.normalize(chat, false)
+ object = Object.normalize(chat, f
etch: f
alse)
[notification] = Notification.for_user(recipient)
res = Impl.build_content(notification, user, object)
[notification] = Notification.for_user(recipient)
res = Impl.build_content(notification, user, object)
@@
-245,7
+245,7
@@
defmodule Pleroma.Web.Push.ImplTest do
{:ok, upload} = ActivityPub.upload(file, actor: user.ap_id)
{:ok, chat} = CommonAPI.post_chat_message(user, recipient, nil, media_id: upload.id)
{:ok, upload} = ActivityPub.upload(file, actor: user.ap_id)
{:ok, chat} = CommonAPI.post_chat_message(user, recipient, nil, media_id: upload.id)
- object = Object.normalize(chat, false)
+ object = Object.normalize(chat, f
etch: f
alse)
[notification] = Notification.for_user(recipient)
res = Impl.build_content(notification, user, object)
[notification] = Notification.for_user(recipient)
res = Impl.build_content(notification, user, object)
@@
-271,7
+271,7
@@
defmodule Pleroma.Web.Push.ImplTest do
notif = insert(:notification, user: user2, activity: activity)
actor = User.get_cached_by_ap_id(notif.activity.data["actor"])
notif = insert(:notification, user: user2, activity: activity)
actor = User.get_cached_by_ap_id(notif.activity.data["actor"])
- object = Object.normalize(activity)
+ object = Object.normalize(activity
, fetch: false
)
assert Impl.build_content(notif, actor, object) == %{
body: "New Direct Message"
assert Impl.build_content(notif, actor, object) == %{
body: "New Direct Message"
@@
-286,7
+286,7
@@
defmodule Pleroma.Web.Push.ImplTest do
notif = insert(:notification, user: user2, activity: activity, type: "mention")
actor = User.get_cached_by_ap_id(notif.activity.data["actor"])
notif = insert(:notification, user: user2, activity: activity, type: "mention")
actor = User.get_cached_by_ap_id(notif.activity.data["actor"])
- object = Object.normalize(activity)
+ object = Object.normalize(activity
, fetch: false
)
assert Impl.build_content(notif, actor, object) == %{
body: "New Mention"
assert Impl.build_content(notif, actor, object) == %{
body: "New Mention"
@@
-297,7
+297,7
@@
defmodule Pleroma.Web.Push.ImplTest do
notif = insert(:notification, user: user2, activity: activity, type: "favourite")
actor = User.get_cached_by_ap_id(notif.activity.data["actor"])
notif = insert(:notification, user: user2, activity: activity, type: "favourite")
actor = User.get_cached_by_ap_id(notif.activity.data["actor"])
- object = Object.normalize(activity)
+ object = Object.normalize(activity
, fetch: false
)
assert Impl.build_content(notif, actor, object) == %{
body: "New Favorite"
assert Impl.build_content(notif, actor, object) == %{
body: "New Favorite"
@@
-320,7
+320,7
@@
defmodule Pleroma.Web.Push.ImplTest do
notif = insert(:notification, user: user2, activity: activity)
actor = User.get_cached_by_ap_id(notif.activity.data["actor"])
notif = insert(:notification, user: user2, activity: activity)
actor = User.get_cached_by_ap_id(notif.activity.data["actor"])
- object = Object.normalize(activity)
+ object = Object.normalize(activity
, fetch: false
)
assert Impl.build_content(notif, actor, object) == %{
body:
assert Impl.build_content(notif, actor, object) == %{
body:
@@
-338,7
+338,7
@@
defmodule Pleroma.Web.Push.ImplTest do
notif = insert(:notification, user: user2, activity: activity, type: "mention")
actor = User.get_cached_by_ap_id(notif.activity.data["actor"])
notif = insert(:notification, user: user2, activity: activity, type: "mention")
actor = User.get_cached_by_ap_id(notif.activity.data["actor"])
- object = Object.normalize(activity)
+ object = Object.normalize(activity
, fetch: false
)
assert Impl.build_content(notif, actor, object) == %{
body:
assert Impl.build_content(notif, actor, object) == %{
body:
@@
-351,7
+351,7
@@
defmodule Pleroma.Web.Push.ImplTest do
notif = insert(:notification, user: user2, activity: activity, type: "favourite")
actor = User.get_cached_by_ap_id(notif.activity.data["actor"])
notif = insert(:notification, user: user2, activity: activity, type: "favourite")
actor = User.get_cached_by_ap_id(notif.activity.data["actor"])
- object = Object.normalize(activity)
+ object = Object.normalize(activity
, fetch: false
)
assert Impl.build_content(notif, actor, object) == %{
body: "@Bob has favorited your post",
assert Impl.build_content(notif, actor, object) == %{
body: "@Bob has favorited your post",