Add user profile hub with account, settings and data export (#103)

This commit is contained in:
2026-11-06 21:13:37 +01:00
committed by GitHub
parent f5efcde5ca
commit c71f465487
21 changed files with 893 additions and 251 deletions
@@ -3,8 +3,33 @@ defmodule ChesstrainerWeb.LayoutsTest do
import Phoenix.LiveViewTest
alias Chesstrainer.Accounts.Scope
alias Chesstrainer.Accounts.User
alias ChesstrainerWeb.Layouts
describe "navbar/1" do
test "signed-in users get a profile menu" do
scope = Scope.for_user(%User{username: "alice"})
html = render_component(&Layouts.navbar/1, %{current_scope: scope})
assert html =~ "alice"
assert html =~ ~s(class="nav-user-menu")
assert html =~ ~p"/users/profile"
assert html =~ ~p"/users/profile/settings"
assert html =~ ~p"/users/profile/data"
assert html =~ ~p"/users/log-out"
end
test "guests get log in and register links" do
html = render_component(&Layouts.navbar/1, %{current_scope: nil})
assert html =~ ~p"/users/log-in"
assert html =~ ~p"/users/register"
refute html =~ ~s(class="nav-user-menu")
end
end
describe "colour_mode_toggle/1" do
test "renders all three modes as a labelled radiogroup" do
html = render_component(&Layouts.colour_mode_toggle/1, %{})