diff options
| author | feld <feld@feld.me> | 2019-12-05 13:34:34 +0000 |
|---|---|---|
| committer | feld <feld@feld.me> | 2019-12-05 13:34:34 +0000 |
| commit | d0bd4348b34075e1d9ed6905255c85c452e0b4ca (patch) | |
| tree | cc088ae9f32d5e69b5fd08936e5a855fd52adfe1 /test/web/activity_pub | |
| parent | 228bf4d214abe3bb62c52128d3bc145e396b174d (diff) | |
| parent | fcabcab4430b0aa075243bf98630d67c79f3ef9b (diff) | |
| download | pleroma-d0bd4348b34075e1d9ed6905255c85c452e0b4ca.tar.gz pleroma-d0bd4348b34075e1d9ed6905255c85c452e0b4ca.zip | |
Merge branch 'feature/admin-api-render-whole-status' into 'develop'
Miscellaneous grouped reports fixes
Closes admin-fe#48 and admin-fe#51
See merge request pleroma/pleroma!2007
Diffstat (limited to 'test/web/activity_pub')
| -rw-r--r-- | test/web/activity_pub/utils_test.exs | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/test/web/activity_pub/utils_test.exs b/test/web/activity_pub/utils_test.exs index 1feb076ba..586eb1d2f 100644 --- a/test/web/activity_pub/utils_test.exs +++ b/test/web/activity_pub/utils_test.exs @@ -636,47 +636,4 @@ defmodule Pleroma.Web.ActivityPub.UtilsTest do assert updated_object.data["announcement_count"] == 1 end end - - describe "get_reports_grouped_by_status/1" do - setup do - [reporter, target_user] = insert_pair(:user) - first_status = insert(:note_activity, user: target_user) - second_status = insert(:note_activity, user: target_user) - - CommonAPI.report(reporter, %{ - "account_id" => target_user.id, - "comment" => "I feel offended", - "status_ids" => [first_status.id] - }) - - CommonAPI.report(reporter, %{ - "account_id" => target_user.id, - "comment" => "I feel offended2", - "status_ids" => [second_status.id] - }) - - data = [%{activity: first_status.data["id"]}, %{activity: second_status.data["id"]}] - - {:ok, - %{ - first_status: first_status, - second_status: second_status, - data: data - }} - end - - test "works for deprecated reports format", %{ - first_status: first_status, - second_status: second_status, - data: data - } do - groups = Utils.get_reports_grouped_by_status(data).groups - - first_group = Enum.find(groups, &(&1.status.id == first_status.data["id"])) - second_group = Enum.find(groups, &(&1.status.id == second_status.data["id"])) - - assert first_group.status.id == first_status.data["id"] - assert second_group.status.id == second_status.data["id"] - end - end end |
