diff --git a/test/mv_web/live/profile_navigation_test.exs b/test/mv_web/live/profile_navigation_test.exs index 1edd3ad..fdea3d3 100644 --- a/test/mv_web/live/profile_navigation_test.exs +++ b/test/mv_web/live/profile_navigation_test.exs @@ -60,17 +60,22 @@ defmodule MvWeb.ProfileNavigationTest do assert html =~ "Profil" end - @tag :skip - # credo:disable-for-next-line Credo.Check.Design.TagTODO - # TODO: Implement user initials in navbar avatar - see issue #170 - test "shows user initials in avatar", %{conn: conn} do - # Setup: Create and login a user + test "shows first letter of email in avatar", %{conn: conn, actor: actor} do + # Current behavior: sidebar shows first letter of email (see issue #170 for full initials) user = create_test_user(%{email: "test.user@example.com"}) + admin_role = Mv.Fixtures.role_fixture("admin") + + {:ok, user} = + user + |> Ash.Changeset.for_update(:update, %{}) + |> Ash.Changeset.manage_relationship(:role, admin_role, type: :append_and_remove) + |> Ash.update(actor: actor) + conn = conn_with_password_user(conn, user) {:ok, _view, html} = live(conn, "/") - # Initials from test.user@example.com - assert html =~ "TU" + assert html =~ "avatar" + assert html =~ ~r/text-sm font-semibold[^>]*>\s*T\s*