Add with_move query param to the notifications API
This commit is contained in:
parent
7722e5a67a
commit
624e720aa4
6 changed files with 55 additions and 15 deletions
|
|
@ -109,22 +109,22 @@ defmodule Pleroma.Web.MastodonAPI.NotificationViewTest do
|
|||
end
|
||||
|
||||
test "Move notification" do
|
||||
%{ap_id: old_ap_id} = old_user = insert(:user)
|
||||
%{ap_id: _new_ap_id} = new_user = insert(:user, also_known_as: [old_ap_id])
|
||||
old_user = insert(:user)
|
||||
new_user = insert(:user, also_known_as: [old_user.ap_id])
|
||||
follower = insert(:user)
|
||||
|
||||
User.follow(follower, old_user)
|
||||
Pleroma.Web.ActivityPub.ActivityPub.move(old_user, new_user)
|
||||
Pleroma.Tests.ObanHelpers.perform_all()
|
||||
|
||||
[notification] = Notification.for_user(follower)
|
||||
[notification] = Notification.for_user(follower, %{with_move: true})
|
||||
|
||||
expected = %{
|
||||
id: to_string(notification.id),
|
||||
pleroma: %{is_seen: false},
|
||||
type: "move",
|
||||
account: AccountView.render("show.json", %{user: old_user, for: follower}),
|
||||
target: AccountView.render("show.json", %{user: new_user, for: follower}),
|
||||
target: AccountView.render("show.json", %{user: refresh_record(new_user), for: follower}),
|
||||
created_at: Utils.to_masto_date(notification.inserted_at)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue