purge chat and shout endpoints
[akkoma] / test / pleroma / web / admin_api / controllers / report_controller_test.exs
index 99cc7bbd0505cbfbaef312826e88e841e12db427..2d526527b2ee8967730b813e80578484b4efd5f8 100644 (file)
@@ -360,10 +360,17 @@ defmodule Pleroma.Web.AdminAPI.ReportControllerTest do
 
       response = json_response_and_validate_schema(conn, 200)
       notes = hd(response["reports"])["notes"]
-      [note, _] = notes
+      assert 2 == Enum.count(notes)
+
+      note =
+        notes
+        |> Enum.find(fn note -> note["content"] == "this is disgusting!" end)
+
+      refute is_nil(note)
 
       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