logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 5f37db330f28556fa6c4c7b2559e6b4663ab4417
parent d7c53da77adfcfc5cf1fd83dd0671b9de8147e15
Author: Ilja <ilja@ilja.space>
Date:   Tue,  5 Apr 2022 13:21:09 +0200

Fix eratic test for POST /api/pleroma/admin/reports/:id/notes

It retrieved two ReportNotes and then checked one of them. But the order isn't guaranteed, while the test tested on the content of the first ReportNote.

I made the test on the content more generic

Diffstat:

Mtest/pleroma/web/admin_api/controllers/report_controller_test.exs4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/pleroma/web/admin_api/controllers/report_controller_test.exs b/test/pleroma/web/admin_api/controllers/report_controller_test.exs @@ -355,7 +355,6 @@ defmodule Pleroma.Web.AdminAPI.ReportControllerTest do } = note end - @tag :erratic test "it returns reports with notes", %{conn: conn, admin: admin} do conn = get(conn, "/api/pleroma/admin/reports") @@ -364,7 +363,8 @@ defmodule Pleroma.Web.AdminAPI.ReportControllerTest do [note, _] = notes assert note["user"]["nickname"] == admin.nickname - assert note["content"] == "this is disgusting!" + # We use '=~' because the order of the notes isn't guaranteed + assert note["content"] =~ "this is disgusting" assert note["created_at"] assert response["total"] == 1 end