test: re-enable profile avatar test for first letter of email
This commit is contained in:
parent
137dca523a
commit
f430762555
1 changed files with 12 additions and 7 deletions
|
|
@ -60,17 +60,22 @@ defmodule MvWeb.ProfileNavigationTest do
|
||||||
assert html =~ "Profil"
|
assert html =~ "Profil"
|
||||||
end
|
end
|
||||||
|
|
||||||
@tag :skip
|
test "shows first letter of email in avatar", %{conn: conn, actor: actor} do
|
||||||
# credo:disable-for-next-line Credo.Check.Design.TagTODO
|
# Current behavior: sidebar shows first letter of email (see issue #170 for full initials)
|
||||||
# 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
|
|
||||||
user = create_test_user(%{email: "test.user@example.com"})
|
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)
|
conn = conn_with_password_user(conn, user)
|
||||||
{:ok, _view, html} = live(conn, "/")
|
{:ok, _view, html} = live(conn, "/")
|
||||||
|
|
||||||
# Initials from test.user@example.com
|
assert html =~ "avatar"
|
||||||
assert html =~ "<span>TU</span>"
|
assert html =~ ~r/text-sm font-semibold[^>]*>\s*T\s*</
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue