improve setup UX: password field, setup hook, checklist banners, theme tweaks
All checks were successful
deploy / deploy (push) Successful in 1m31s
All checks were successful
deploy / deploy (push) Successful in 1m31s
- add password field and required shop name to setup wizard - extract SetupHook for DRY redirect to /setup when no admin exists - add ?from=checklist param to checklist hrefs with contextual banner on email settings and theme pages for easy return to dashboard - remove email warning banner from admin layout (checklist covers it) - make email a required checklist item (no longer optional) - add DevReset module for wiping dev data without restart - rename "Theme Studio" to "Theme", drop subtitle - lower theme editor side-by-side breakpoint from 64em to 48em - clean up login/registration pages (remove dead registration_open code) - fix settings.put_secret to invalidate cache after write Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ defmodule BerrypodWeb.Auth.LoginTest do
|
||||
|
||||
describe "login page" do
|
||||
setup do
|
||||
user_fixture()
|
||||
Mailer.mark_email_verified()
|
||||
:ok
|
||||
end
|
||||
@@ -16,7 +17,6 @@ defmodule BerrypodWeb.Auth.LoginTest do
|
||||
{:ok, _lv, html} = live(conn, ~p"/users/log-in")
|
||||
|
||||
assert html =~ "Log in"
|
||||
assert html =~ "Set up your shop"
|
||||
assert html =~ "Log in with email"
|
||||
end
|
||||
end
|
||||
@@ -44,6 +44,8 @@ defmodule BerrypodWeb.Auth.LoginTest do
|
||||
end
|
||||
|
||||
test "does not disclose if user is registered", %{conn: conn} do
|
||||
user_fixture()
|
||||
|
||||
{:ok, lv, _html} = live(conn, ~p"/users/log-in")
|
||||
|
||||
{:ok, _lv, html} =
|
||||
@@ -74,6 +76,8 @@ defmodule BerrypodWeb.Auth.LoginTest do
|
||||
test "redirects to login page with a flash error if credentials are invalid", %{
|
||||
conn: conn
|
||||
} do
|
||||
user_fixture()
|
||||
|
||||
{:ok, lv, _html} = live(conn, ~p"/users/log-in")
|
||||
|
||||
form =
|
||||
@@ -107,6 +111,9 @@ defmodule BerrypodWeb.Auth.LoginTest do
|
||||
|
||||
describe "email configured and verified" do
|
||||
setup do
|
||||
# Create user before switching adapter (fixture sends a confirmation email)
|
||||
_user = user_fixture()
|
||||
|
||||
original = Application.get_env(:berrypod, Berrypod.Mailer)
|
||||
|
||||
Application.put_env(:berrypod, Berrypod.Mailer,
|
||||
@@ -154,17 +161,9 @@ defmodule BerrypodWeb.Auth.LoginTest do
|
||||
end
|
||||
end
|
||||
|
||||
describe "login navigation" do
|
||||
test "redirects to setup page when the setup link is clicked", %{conn: conn} do
|
||||
{:ok, lv, _html} = live(conn, ~p"/users/log-in")
|
||||
|
||||
{:ok, _setup_live, setup_html} =
|
||||
lv
|
||||
|> element("main a", "Set up your shop")
|
||||
|> render_click()
|
||||
|> follow_redirect(conn, ~p"/setup")
|
||||
|
||||
assert setup_html =~ "Set up your shop"
|
||||
describe "no admin exists" do
|
||||
test "redirects to setup", %{conn: conn} do
|
||||
assert {:error, {:redirect, %{to: "/setup"}}} = live(conn, ~p"/users/log-in")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user