From 40fa1099bf9770dd0535690c1b1ebf8aad60306b Mon Sep 17 00:00:00 2001 From: Lain Soykaf Date: Wed, 13 Dec 2023 11:19:08 +0400 Subject: [PATCH] StatusViewTest: Fix tests. --- changelog.d/fix-tests.skip | 0 test/pleroma/web/mastodon_api/views/status_view_test.exs | 8 +++++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelog.d/fix-tests.skip diff --git a/changelog.d/fix-tests.skip b/changelog.d/fix-tests.skip new file mode 100644 index 000000000..e69de29bb diff --git a/test/pleroma/web/mastodon_api/views/status_view_test.exs b/test/pleroma/web/mastodon_api/views/status_view_test.exs index b31955891..d82eeb7af 100644 --- a/test/pleroma/web/mastodon_api/views/status_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/status_view_test.exs @@ -11,6 +11,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do alias Pleroma.HTML alias Pleroma.Object alias Pleroma.Repo + alias Pleroma.UnstubbedConfigMock, as: ConfigMock alias Pleroma.User alias Pleroma.UserRelationship alias Pleroma.Web.CommonAPI @@ -19,9 +20,10 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do require Bitwise + import Mox + import OpenApiSpex.TestAssertions import Pleroma.Factory import Tesla.Mock - import OpenApiSpex.TestAssertions setup do mock(fn env -> apply(HttpRequestMock, :request, [env]) end) @@ -198,6 +200,7 @@ test "returns the direct conversation id when given the `direct_conversation_id` assert_schema(status, "Status", Pleroma.Web.ApiSpec.spec()) end + @tag capture_log: true test "returns a temporary ap_id based user for activities missing db users" do user = insert(:user) @@ -784,6 +787,9 @@ test "a rich media card has all media proxied" do clear_config([:media_proxy, :enabled], true) clear_config([:media_preview_proxy, :enabled]) + ConfigMock + |> stub_with(Pleroma.Test.StaticConfig) + page_url = "http://example.com" card = %{