logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/
commit: 113261146ff5e643c9598189f8157dfd60516016
parent b54b19a0f4fa3c7220994f259e1a0d12757321ff
Author: Mark Felder <feld@feld.me>
Date:   Tue, 22 Jul 2025 13:28:25 -0700

Fix account endorsements test

Random failures were caused by the results sometimes being returned out of order.

Diffstat:

Mtest/pleroma/web/pleroma_api/controllers/account_controller_test.exs6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs b/test/pleroma/web/pleroma_api/controllers/account_controller_test.exs @@ -292,10 +292,14 @@ defmodule Pleroma.Web.PleromaAPI.AccountControllerTest do User.endorse(user1, user2) User.endorse(user1, user3) - [%{"id" => ^id2}, %{"id" => ^id3}] = + response = conn |> get("/api/v1/pleroma/accounts/#{id1}/endorsements") |> json_response_and_validate_schema(200) + + assert length(response) == 2 + assert Enum.any?(response, fn user -> user["id"] == id2 end) + assert Enum.any?(response, fn user -> user["id"] == id3 end) end test "returns 404 error when specified user is not exist", %{conn: conn} do