+
+ test "muted reactions", %{user: user, conn: conn} do
+ user2 = insert(:user)
+ User.mute(user, user2)
+ {:ok, activity} = CommonAPI.post(user, %{status: "."})
+ {:ok, _} = CommonAPI.react_with_emoji(activity.id, user2, "🎅")
+
+ result =
+ conn
+ |> get("/api/v1/accounts/#{user.id}/statuses")
+ |> json_response_and_validate_schema(200)
+
+ assert [
+ %{
+ "pleroma" => %{
+ "emoji_reactions" => []
+ }
+ }
+ ] = result
+
+ result =
+ conn
+ |> get("/api/v1/accounts/#{user.id}/statuses?with_muted=true")
+ |> json_response_and_validate_schema(200)
+
+ assert [
+ %{
+ "pleroma" => %{
+ "emoji_reactions" => [%{"count" => 1, "me" => false, "name" => "🎅"}]
+ }
+ }
+ ] = result
+ end
+
+ test "paginates a user's statuses", %{user: user, conn: conn} do
+ {:ok, post1} = CommonAPI.post(user, %{status: "first post"})
+ {:ok, _} = CommonAPI.post(user, %{status: "second post"})
+
+ response1 = get(conn, "/api/v1/accounts/#{user.id}/statuses?limit=1")
+ assert json_response(response1, 200) |> length() == 1
+
+ response2 = get(conn, "/api/v1/accounts/#{user.id}/statuses?limit=1&min_id=#{post1.id}")
+ assert json_response(response2, 200) |> length() == 1
+
+ refute response1 == response2
+ end