Mastodon API: Add pleroma.unread_conversation_count to the Account entity
This commit is contained in:
parent
4fe2af3b2d
commit
06d9df79c5
11 changed files with 211 additions and 14 deletions
|
|
@ -6,6 +6,7 @@ defmodule Pleroma.Conversation.ParticipationTest do
|
|||
use Pleroma.DataCase
|
||||
import Pleroma.Factory
|
||||
alias Pleroma.Conversation.Participation
|
||||
alias Pleroma.User
|
||||
alias Pleroma.Web.CommonAPI
|
||||
|
||||
test "getting a participation will also preload things" do
|
||||
|
|
@ -30,6 +31,8 @@ defmodule Pleroma.Conversation.ParticipationTest do
|
|||
{:ok, activity} =
|
||||
CommonAPI.post(user, %{"status" => "Hey @#{other_user.nickname}.", "visibility" => "direct"})
|
||||
|
||||
user = User.get_cached_by_id(user.id)
|
||||
other_user = User.get_cached_by_id(user.id)
|
||||
[participation] = Participation.for_user(user)
|
||||
participation = Pleroma.Repo.preload(participation, :recipients)
|
||||
|
||||
|
|
@ -155,6 +158,7 @@ defmodule Pleroma.Conversation.ParticipationTest do
|
|||
[participation] = Participation.for_user_with_last_activity_id(user)
|
||||
|
||||
participation = Repo.preload(participation, :recipients)
|
||||
user = User.get_cached_by_id(user.id)
|
||||
|
||||
assert participation.recipients |> length() == 1
|
||||
assert user in participation.recipients
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue