1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.MastodonAPI.SuggestionViewTest do
6 use Pleroma.DataCase, async: true
8 alias Pleroma.Web.MastodonAPI.SuggestionView, as: View
11 user = insert(:user, is_suggested: true)
12 json = View.render("show.json", %{user: user, source: :staff, skip_visibility_check: true})
14 assert json.source == :staff
15 assert json.account.id == user.id
19 user1 = insert(:user, is_suggested: true)
20 user2 = insert(:user, is_suggested: true)
21 user3 = insert(:user, is_suggested: true)
23 [suggestion1, suggestion2, suggestion3] =
24 View.render("index.json", %{
25 users: [user1, user2, user3],
27 skip_visibility_check: true
30 assert suggestion1.source == :staff
31 assert suggestion2.account.id == user2.id
32 assert suggestion3.account.url == user3.ap_id