From c03852fbc78f8b02aef2189409f393a339ac113f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= <git@mkljczk.pl>
Date: Wed, 23 Nov 2022 00:13:06 +0100
Subject: [PATCH] update tests
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
---
 test/pleroma/user_test.exs | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs
index 7f60b959a..a8bd509a9 100644
--- a/test/pleroma/user_test.exs
+++ b/test/pleroma/user_test.exs
@@ -2678,13 +2678,25 @@ defmodule Pleroma.UserTest do
   end
 
   describe "full_nickname/1" do
-    test "returns fully qualified nickname for local and remote users" do
-      local_user =
-        insert(:user, nickname: "local_user", ap_id: "https://somehost.com/users/local_user")
+    test "returns fully qualified nickname for local users" do
+      local_user = insert(:user, nickname: "local_user")
 
+      assert User.full_nickname(local_user) == "local_user@localhost"
+    end
+
+    test "returns fully qualified nickname for local users when using different domain for webfinger" do
+      clear_config([Pleroma.Web.WebFinger, :domain], "plemora.dev")
+
+      host = Pleroma.Web.Endpoint.host()
+
+      local_user = insert(:user, nickname: "local_user")
+
+      assert User.full_nickname(local_user) == "local_user@plemora.dev"
+    end
+
+    test "returns fully qualified nickname for remote users" do
       remote_user = insert(:user, nickname: "remote@host.com", local: false)
 
-      assert User.full_nickname(local_user) == "local_user@somehost.com"
       assert User.full_nickname(remote_user) == "remote@host.com"
     end