fix tests?

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2023-11-20 21:34:08 +01:00
parent 739dbfff6f
commit ea1805218c
6 changed files with 15 additions and 7 deletions

View file

@ -611,9 +611,7 @@ def handle_incoming(
end
end
def handle_incoming(_, _) do
IO.inspect(:error)
end
def handle_incoming(_, _), do: :error
@spec get_obj_helper(String.t(), Keyword.t()) :: {:ok, Object.t()} | nil
def get_obj_helper(id, options \\ []) do

View file

@ -10,6 +10,7 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do
import Pleroma.Factory
alias Pleroma.Integration.WebsocketClient
alias Pleroma.Tests.ObanHelpers
alias Pleroma.Web.CommonAPI
alias Pleroma.Web.OAuth
@ -21,6 +22,11 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do
|> Map.put(:path, "/api/v1/streaming")
|> URI.to_string()
setup do
Mox.stub_with(Pleroma.UnstubbedConfigMock, Pleroma.Config)
:ok
end
def start_socket(qs \\ nil, headers \\ []) do
path =
case qs do
@ -480,6 +486,8 @@ test "receives notifications", %{user: reading_user, token: token} do
visibility: "private"
})
ObanHelpers.perform_all()
assert_receive {:text, raw_json}, 1_000
assert {:ok,

View file

@ -24,6 +24,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
import Tesla.Mock
setup do
Mox.stub_with(Pleroma.UnstubbedConfigMock, Pleroma.Config)
mock(fn env -> apply(HttpRequestMock, :request, [env]) end)
:ok
end

View file

@ -29,8 +29,10 @@ defmodule Pleroma.Web.CommonAPITest do
setup_all do
Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
Mox.stub_with(Pleroma.UnstubbedConfigMock, Pleroma.Config)
end
setup do
Mox.stub_with(Pleroma.UnstubbedConfigMock, Pleroma.Config)
:ok
end

View file

@ -445,7 +445,6 @@ test "a quote post" do
assert status.pleroma.quote_visible
# Quotes don't go more than one level deep\
IO.inspect(status.pleroma.quote.pleroma)
refute status.pleroma.quote.pleroma.quote
assert status.pleroma.quote.pleroma.quote_id == to_string(post.id)
assert status.pleroma.quote.pleroma.quote_url == Object.normalize(post).data["id"]

View file

@ -11,9 +11,9 @@ defmodule Pleroma.Workers.Cron.DigestEmailsWorkerTest do
alias Pleroma.User
alias Pleroma.Web.CommonAPI
setup do: clear_config([:email_notifications, :digest])
setup do
clear_config([:email_notifications, :digest])
Mox.stub_with(Pleroma.UnstubbedConfigMock, Pleroma.Config)
:ok
end