+
<.label for={f[:two_factor_code].id} class="mb-2">
Verify with 2FA Code
@@ -99,6 +99,7 @@
form={f}
show_button?={false}
field={:two_factor_code}
+ class="w-1/2"
/>
diff --git a/lib/plausible_web/user_auth.ex b/lib/plausible_web/user_auth.ex
index 48c782efbc58..16c0bdcd66e9 100644
--- a/lib/plausible_web/user_auth.ex
+++ b/lib/plausible_web/user_auth.ex
@@ -51,7 +51,10 @@ defmodule PlausibleWeb.UserAuth do
{:error, :integration_not_found} ->
conn
|> log_out_user()
- |> Phoenix.Controller.put_flash(:login_error, "Wrong email.")
+ |> Phoenix.Controller.put_flash(
+ :login_error,
+ "We couldn't find a Single Sign-On account for that email."
+ )
|> Phoenix.Controller.redirect(
to: Routes.sso_path(conn, :login_form, return_to: redirect_path)
)
diff --git a/test/plausible_web/components/flow_progress_test.exs b/test/plausible_web/components/flow_progress_test.exs
index 34e512e75d19..383612e1eb9a 100644
--- a/test/plausible_web/components/flow_progress_test.exs
+++ b/test/plausible_web/components/flow_progress_test.exs
@@ -27,11 +27,11 @@ defmodule PlausibleWeb.Components.FlowProgressTest do
rendered =
render_component(&FlowProgress.render/1,
flow: PlausibleWeb.Flows.register(),
- current_step: "Register"
+ current_step: "Add site info"
)
assert text_of_element(rendered, "#flow-progress") ==
- "1 Register 2 Activate account 3 Add site info 4 Install Plausible 5 Verify installation"
+ "1 Add site info 2 Install Plausible 3 Verify installation"
end
test "invitation" do
diff --git a/test/plausible_web/controllers/admin_auth_controller_test.exs b/test/plausible_web/controllers/admin_auth_controller_test.exs
index 517f1654cc30..dc1920be953b 100644
--- a/test/plausible_web/controllers/admin_auth_controller_test.exs
+++ b/test/plausible_web/controllers/admin_auth_controller_test.exs
@@ -17,7 +17,7 @@ defmodule PlausibleWeb.AdminAuthControllerTest do
# "first launch" takes precedence
conn = get(conn, "/register")
- assert html_response(conn, 200) =~ "Enter your details"
+ assert html_response(conn, 200) =~ "Create your Plausible CE account"
end
end
diff --git a/test/plausible_web/controllers/auth_controller_test.exs b/test/plausible_web/controllers/auth_controller_test.exs
index c63e3f016430..78ae1fc00979 100644
--- a/test/plausible_web/controllers/auth_controller_test.exs
+++ b/test/plausible_web/controllers/auth_controller_test.exs
@@ -19,7 +19,13 @@ defmodule PlausibleWeb.AuthControllerTest do
test "shows the register form", %{conn: conn} do
conn = get(conn, "/register")
- assert html_response(conn, 200) =~ "Enter your details"
+ html = html_response(conn, 200)
+
+ if ee?() do
+ assert html =~ "Start your 30-day free trial"
+ else
+ assert html =~ "Create your #{Plausible.product_name()} account"
+ end
end
end
@@ -103,7 +109,7 @@ defmodule PlausibleWeb.AuthControllerTest do
conn = get(conn, "/register/invitation/#{invitation.invitation_id}")
- assert html_response(conn, 200) =~ "Enter your details"
+ assert html_response(conn, 200) =~ "Accept your invitation to join your team."
end
end
@@ -287,7 +293,7 @@ defmodule PlausibleWeb.AuthControllerTest do
test "if user does not have a code: prompts user to request activation code", %{conn: conn} do
conn = get(conn, "/activate")
- assert html_response(conn, 200) =~ "Request activation code"
+ assert html_response(conn, 200) =~ "Send activation code"
end
test "if user does have a code: prompts user to enter the activation code from their email",
@@ -296,7 +302,7 @@ defmodule PlausibleWeb.AuthControllerTest do
post(conn, "/activate/request-code")
|> get("/activate")
- assert html_response(conn, 200) =~ "Please enter the 4-digit code we sent to"
+ assert html_response(conn, 200) =~ "We've sent an email with your code to:"
end
test "passes team identifier in form data", %{conn: conn, user: user} do
@@ -372,7 +378,8 @@ defmodule PlausibleWeb.AuthControllerTest do
test "with wrong pin - reloads the form with error", %{conn: conn} do
conn = post(conn, "/activate", %{code: "1234"})
- assert html_response(conn, 200) =~ "Incorrect activation code"
+ assert html_response(conn, 200) =~
+ htmlize_quotes("That code didn't work. Please try again.")
end
test "with expired pin - reloads the form with error", %{conn: conn, user: user} do
@@ -385,7 +392,7 @@ defmodule PlausibleWeb.AuthControllerTest do
conn = post(conn, "/activate", %{code: verification.code})
- assert html_response(conn, 200) =~ "Code is expired, please request another one"
+ assert html_response(conn, 200) =~ "The code has expired. Please request another one."
end
test "marks the user account as active", %{conn: conn, user: user} do
@@ -479,20 +486,22 @@ defmodule PlausibleWeb.AuthControllerTest do
end)
conn = post(conn, "/activate", %{code: "1111"})
+ body = html_response(conn, 200)
- {conn.status == 429, conn}
+ {body =~ "Too many attempts", conn}
end,
500
)
- assert html_response(response, 429) =~ "Too many activation attempts"
+ assert html_response(response, 200) =~
+ "Too many attempts. Please wait a few minutes before trying again."
end
end
describe "GET /login_form" do
test "shows the login form", %{conn: conn} do
conn = get(conn, "/login")
- assert html_response(conn, 200) =~ "Enter your account credentials"
+ assert html_response(conn, 200) =~ "Sign in to your account"
end
test "renders `return_to` query param as hidden input", %{conn: conn} do
@@ -517,7 +526,7 @@ defmodule PlausibleWeb.AuthControllerTest do
test "keeps standard login form if preference manually overridden", %{conn: conn} do
conn = PlausibleWeb.LoginPreference.set_sso(conn)
conn = get(conn, "/login?prefer=manual")
- assert html_response(conn, 200) =~ "Enter your account credentials"
+ assert html_response(conn, 200) =~ "Sign in to your account"
end
end
@@ -659,7 +668,7 @@ defmodule PlausibleWeb.AuthControllerTest do
conn = post(conn, "/login", email: member.email, password: "password")
assert get_session(conn, :user_token) == nil
- assert html_response(conn, 200) =~ "Enter your account credentials"
+ assert html_response(conn, 200) =~ "Sign in to your account"
end
test "SSO user other than owner with personal team - renders login form again", %{
@@ -683,7 +692,7 @@ defmodule PlausibleWeb.AuthControllerTest do
conn = post(conn, "/login", email: member.email, password: "password")
assert get_session(conn, :user_token) == nil
- assert html_response(conn, 200) =~ "Enter your account credentials"
+ assert html_response(conn, 200) =~ "Sign in to your account"
end
end
@@ -691,7 +700,7 @@ defmodule PlausibleWeb.AuthControllerTest do
conn = post(conn, "/login", email: "user@example.com", password: "password")
assert get_session(conn, :user_token) == nil
- assert html_response(conn, 200) =~ "Enter your account credentials"
+ assert html_response(conn, 200) =~ "Sign in to your account"
end
test "bad password - renders login form again", %{conn: conn} do
@@ -699,7 +708,7 @@ defmodule PlausibleWeb.AuthControllerTest do
conn = post(conn, "/login", email: user.email, password: "wrong")
assert get_session(conn, :user_token) == nil
- assert html_response(conn, 200) =~ "Enter your account credentials"
+ assert html_response(conn, 200) =~ "Sign in to your account"
end
test "limits login attempts to 5 per minute" do
@@ -758,7 +767,7 @@ defmodule PlausibleWeb.AuthControllerTest do
describe "GET /password/request-reset" do
test "renders the form", %{conn: conn} do
conn = get(conn, "/password/request-reset")
- assert html_response(conn, 200) =~ "Enter your email so we can send a password reset link"
+ assert html_response(conn, 200) =~ "Enter your email to receive a password reset link."
end
end
@@ -766,7 +775,7 @@ defmodule PlausibleWeb.AuthControllerTest do
test "email is empty - renders form with error", %{conn: conn} do
conn = post(conn, "/password/request-reset", %{email: ""})
- assert html_response(conn, 200) =~ "Enter your email so we can send a password reset link"
+ assert html_response(conn, 200) =~ "Enter your email to receive a password reset link."
end
test "email is present and exists - sends password reset email", %{conn: conn} do
@@ -774,7 +783,7 @@ defmodule PlausibleWeb.AuthControllerTest do
user = insert(:user)
conn = post(conn, "/password/request-reset", %{email: user.email})
- assert html_response(conn, 200) =~ "Success!"
+ assert html_response(conn, 200) =~ "Check your email"
assert_email_delivered_with(subject: "Plausible password reset")
end
@@ -836,13 +845,13 @@ defmodule PlausibleWeb.AuthControllerTest do
test "with invalid token - shows error page", %{conn: conn} do
conn = get(conn, "/password/reset", %{token: "blabla"})
- assert html_response(conn, 401) =~ "Your token is invalid"
+ assert html_response(conn, 401) =~ "Password reset link invalid"
end
test "without token - shows error page", %{conn: conn} do
conn = get(conn, "/password/reset", %{})
- assert html_response(conn, 401) =~ "Your token is invalid"
+ assert html_response(conn, 401) =~ "Password reset link invalid"
end
end
@@ -1849,10 +1858,7 @@ defmodule PlausibleWeb.AuthControllerTest do
conn = post(conn, Routes.auth_path(conn, :verify_2fa), %{code: "invalid"})
- assert html_response(conn, 200)
-
- assert Phoenix.Flash.get(conn.assigns.flash, :error) =~
- "The provided code is invalid"
+ assert html_response(conn, 200) =~ "The provided code is invalid"
end
test "redirects to login when cookie not found", %{conn: conn} do
@@ -2011,10 +2017,7 @@ defmodule PlausibleWeb.AuthControllerTest do
conn =
post(conn, Routes.auth_path(conn, :verify_2fa_recovery_code), %{recovery_code: "invalid"})
- assert html_response(conn, 200)
-
- assert Phoenix.Flash.get(conn.assigns.flash, :error) =~
- "The provided recovery code is invalid"
+ assert html_response(conn, 200) =~ "The provided recovery code is invalid"
end
test "redirects to login when cookie not found", %{conn: conn} do
diff --git a/test/plausible_web/controllers/sso_controller_sync_test.exs b/test/plausible_web/controllers/sso_controller_sync_test.exs
index 9b7711955a12..e9e3306a15f5 100644
--- a/test/plausible_web/controllers/sso_controller_sync_test.exs
+++ b/test/plausible_web/controllers/sso_controller_sync_test.exs
@@ -141,7 +141,8 @@ defmodule PlausibleWeb.SSOControllerSyncTest do
assert redirected_to(conn, 302) == Routes.sso_path(conn, :login_form, return_to: "/sites")
- assert Phoenix.Flash.get(conn.assigns.flash, :login_error) == "Wrong email."
+ assert Phoenix.Flash.get(conn.assigns.flash, :login_error) ==
+ "We couldn't find a Single Sign-On account for that email."
end
end
@@ -265,7 +266,8 @@ defmodule PlausibleWeb.SSOControllerSyncTest do
assert redirected_to(conn, 302) == Routes.sso_path(conn, :login_form, return_to: "/sites")
- assert Phoenix.Flash.get(conn.assigns.flash, :login_error) == "Wrong email"
+ assert Phoenix.Flash.get(conn.assigns.flash, :login_error) ==
+ "We couldn't find a Single Sign-On account for that email."
end
test "redirects with error on mismatch of RelayState", %{
diff --git a/test/plausible_web/controllers/sso_controller_test.exs b/test/plausible_web/controllers/sso_controller_test.exs
index 3d874b313633..487c4199fb71 100644
--- a/test/plausible_web/controllers/sso_controller_test.exs
+++ b/test/plausible_web/controllers/sso_controller_test.exs
@@ -59,7 +59,7 @@ defmodule PlausibleWeb.SSOControllerTest do
assert html = html_response(conn, 200)
- assert html =~ "Enter your Single Sign-On email"
+ assert html =~ "Sign in with SSO"
assert element_exists?(html, "input[name=email]")
assert text_of_attr(html, ~s|input[name="return_to"]|, "value") == nil
end
@@ -77,7 +77,7 @@ defmodule PlausibleWeb.SSOControllerTest do
assert html = html_response(conn, 200)
- assert html =~ "Enter your Single Sign-On email"
+ assert html =~ "Sign in with SSO"
assert text_of_attr(html, "input[name=email]", "value") == "user@example.com"
assert html =~ ~s|document.getElementById("sso-login-form").submit()|
end
@@ -96,13 +96,13 @@ defmodule PlausibleWeb.SSOControllerTest do
|> init_session()
|> fetch_session()
|> fetch_flash()
- |> put_flash(:login_error, "Wrong email.")
+ |> put_flash(:login_error, "We couldn't find a Single Sign-On account for that email.")
conn = get(conn, Routes.sso_path(conn, :login_form, return_to: "/sites"))
assert html = html_response(conn, 200)
- assert html =~ "Wrong email."
+ assert html =~ htmlize_quotes("We couldn't find a Single Sign-On account for that email.")
assert element_exists?(html, "input[name=email]")
assert text_of_attr(html, "input[name=return_to]", "value") == "/sites"
end
@@ -151,7 +151,8 @@ defmodule PlausibleWeb.SSOControllerTest do
assert redirected_to(conn, 302) == Routes.sso_path(conn, :login_form)
- assert Phoenix.Flash.get(conn.assigns.flash, :login_error) == "Wrong email."
+ assert Phoenix.Flash.get(conn.assigns.flash, :login_error) ==
+ "We couldn't find a Single Sign-On account for that email."
end
test "limits login attempts to 5 per minute", %{conn: conn} do
@@ -264,7 +265,8 @@ defmodule PlausibleWeb.SSOControllerTest do
assert redirected_to(conn, 302) == Routes.sso_path(conn, :login_form, return_to: "/sites")
- assert Phoenix.Flash.get(conn.assigns.flash, :login_error) == "Wrong email."
+ assert Phoenix.Flash.get(conn.assigns.flash, :login_error) ==
+ "We couldn't find a Single Sign-On account for that email."
end
end
@@ -304,10 +306,11 @@ defmodule PlausibleWeb.SSOControllerTest do
assert html = html_response(conn, 200)
- assert html =~ "Single Sign-On enforcement"
- assert html =~ "To access this team, you must first"
- assert html =~ "log out"
- assert html =~ "and log in as SSO user"
+ assert html =~ "Single Sign-On required"
+ assert html =~ "has turned off email and password logins"
+ assert html =~ "To access this team,"
+ assert html =~ "sign out"
+ assert html =~ "and sign in with SSO"
end
end
@@ -317,8 +320,8 @@ defmodule PlausibleWeb.SSOControllerTest do
assert html = html_response(conn, 200)
- assert html =~ "Single Sign-On enforcement"
- assert html =~ "To access this team, you must join as a team member first"
+ assert html =~ "Single Sign-On required"
+ assert html =~ "To access this team, you must be added as a team member first"
end
test "renders issue for multiple_memberships", %{conn: conn} do
@@ -326,8 +329,8 @@ defmodule PlausibleWeb.SSOControllerTest do
assert html = html_response(conn, 200)
- assert html =~ "Single Sign-On enforcement"
- assert html =~ "To access this team, you must first leave all other teams"
+ assert html =~ "Single Sign-On required"
+ assert html =~ "To access this team, you must leave all other teams first"
end
test "renders issue for multiple_memberships_noforce", %{conn: conn} do
@@ -339,11 +342,11 @@ defmodule PlausibleWeb.SSOControllerTest do
assert html = html_response(conn, 200)
- assert html =~ "Single Sign-On enforcement"
- assert html =~ "To log in as an SSO user, you must first leave all other teams"
+ assert html =~ "Single Sign-On required"
+ assert html =~ "To sign in with SSO, you must leave all other teams first"
- assert html =~ "Log in"
- assert html =~ "with your email and password"
+ assert html =~ "Sign in with email and password"
+ assert html =~ "to resolve the issue"
end
test "renders issue for active_personal_team", %{conn: conn} do
@@ -351,8 +354,10 @@ defmodule PlausibleWeb.SSOControllerTest do
assert html = html_response(conn, 200)
- assert html =~ "Single Sign-On enforcement"
- assert html =~ "To access this team, you must either remove or transfer all sites"
+ assert html =~ "Single Sign-On required"
+ assert html =~ "To access this team, remove or transfer all sites under"
+ assert html =~ "My Personal Sites"
+ assert html =~ "cancel its subscription if active"
end
test "renders issue for active_personal_team_noforce", %{conn: conn} do
@@ -364,13 +369,13 @@ defmodule PlausibleWeb.SSOControllerTest do
assert html = html_response(conn, 200)
- assert html =~ "Single Sign-On enforcement"
+ assert html =~ "Single Sign-On required"
+ assert html =~ "To sign in with SSO, remove or transfer all sites under"
+ assert html =~ "My Personal Sites"
+ assert html =~ "cancel its subscription if active"
- assert html =~
- "To log in as an SSO user, you must either remove or transfer all sites"
-
- assert html =~ "Log in"
- assert html =~ "with your email and password"
+ assert html =~ "Sign in with email and password"
+ assert html =~ "to resolve the issue"
end
end
diff --git a/test/plausible_web/live/components/form_test.exs b/test/plausible_web/live/components/form_test.exs
index b411d17cae53..de293f4690bb 100644
--- a/test/plausible_web/live/components/form_test.exs
+++ b/test/plausible_web/live/components/form_test.exs
@@ -10,9 +10,9 @@ defmodule PlausibleWeb.Live.Components.FormTest do
doc = render_password_input_with_strength("very-secret-and-very-long-123")
assert element_exists?(doc, ~s/input#user_password[type="password"][name="user[password]"]/)
- assert element_exists?(doc, ~s/div.rounded-full.bg-indigo-600/)
refute element_exists?(doc, "label")
- refute element_exists?(doc, "p")
+ assert text_of_element(doc, "p") =~ "Password strength:"
+ assert text_of_element(doc, "p") =~ "Strong"
end
test "renders with label when passed" do
@@ -30,7 +30,7 @@ defmodule PlausibleWeb.Live.Components.FormTest do
test "renders weak password warning and hints when password too short" do
doc = render_password_input_with_strength("too-short")
- assert text_of_element(doc, "p:first-of-type") == "Password is too weak"
+ assert text_of_element(doc, "p:first-of-type") == "Password is too weak."
assert text_of_element(doc, "p:last-of-type") != ""
end
@@ -45,7 +45,7 @@ defmodule PlausibleWeb.Live.Components.FormTest do
)
assert warning_p = find(doc, "p")
- assert text(warning_p) == "Password is too weak"
+ assert text(warning_p) == "Password is too weak."
end
test "renders too long password case gracefully" do
@@ -63,7 +63,7 @@ defmodule PlausibleWeb.Live.Components.FormTest do
assert p_hint = find(doc, "p")
assert text_of_attr(p_hint, "class") =~ "text-gray-500"
- assert text(p_hint) == "Min 12 characters"
+ assert text(p_hint) == "At least 12 characters"
end
test "renders for too short password" do
@@ -71,7 +71,7 @@ defmodule PlausibleWeb.Live.Components.FormTest do
assert p_hint = find(doc, "p")
assert text_of_attr(p_hint, "class") =~ "text-red-500"
- assert text(p_hint) == "Min 12 characters"
+ assert text(p_hint) == "At least 12 characters"
end
test "renders gracefully for too long password" do
@@ -80,52 +80,42 @@ defmodule PlausibleWeb.Live.Components.FormTest do
assert p_hint = find(doc, "p")
assert text_of_attr(p_hint, "class") =~ "text-gray-500"
- assert text(p_hint) == "Min 12 characters"
+ assert text(p_hint) == "At least 12 characters"
end
end
describe "strength_meter/1" do
test "renders too weak level" do
doc = render_component(&Form.strength_meter/1, score: 0, warning: "", suggestions: [])
- meter = find(doc, "div.rounded-full")
- assert text_of_attr(meter, "style") == "width: 0%"
- assert p_warning = find(doc, "p")
- assert text(p_warning) == "Password is too weak"
+ refute element_exists?(doc, "div.rounded-full")
+ assert text_of_element(doc, "p") == "Password is too weak."
end
test "renders very weak level" do
doc = render_component(&Form.strength_meter/1, score: 1, warning: "", suggestions: [])
- meter = find(doc, "div.rounded-full")
- assert text_of_attr(meter, "style") == "width: 25%"
- assert p_warning = find(doc, "p")
- assert text(p_warning) == "Password is too weak"
+ assert text_of_element(doc, "p") == "Password is too weak."
end
test "renders somewhat weak level" do
doc = render_component(&Form.strength_meter/1, score: 2, warning: "", suggestions: [])
- meter = find(doc, "div.rounded-full")
- assert text_of_attr(meter, "style") == "width: 50%"
- assert p_warning = find(doc, "p")
- assert text(p_warning) == "Password is too weak"
+ assert text_of_element(doc, "p") == "Password is too weak."
end
test "renders strong level" do
doc = render_component(&Form.strength_meter/1, score: 3, warning: "", suggestions: [])
- meter = find(doc, "div.rounded-full")
- assert text_of_attr(meter, "style") == "width: 75%"
- refute element_exists?(doc, "p")
+ assert text_of_element(doc, "p") =~ "Password strength:"
+ assert text_of_element(doc, "p") =~ "Good"
end
test "renders very strong level" do
doc = render_component(&Form.strength_meter/1, score: 4, warning: "", suggestions: [])
- meter = find(doc, "div.rounded-full")
- assert text_of_attr(meter, "style") == "width: 100%"
- refute element_exists?(doc, "p")
+ assert text_of_element(doc, "p") =~ "Password strength:"
+ assert text_of_element(doc, "p") =~ "Strong"
end
test "renders hints paragraph when warning hint is present" do
diff --git a/test/plausible_web/live/register_form_test.exs b/test/plausible_web/live/register_form_test.exs
index 3cd0811a65e9..3aee16fdef2a 100644
--- a/test/plausible_web/live/register_form_test.exs
+++ b/test/plausible_web/live/register_form_test.exs
@@ -28,11 +28,6 @@ defmodule PlausibleWeb.Live.RegisterFormTest do
~s|input#register-form_password[type="password"][name="user[password]"]|
)
- assert element_exists?(
- html,
- ~s|input#register-form_password_confirmation[type="password"][name="user[password_confirmation]"]|
- )
-
assert element_exists?(html, ~s|button[type="submit"]|)
end
@@ -58,7 +53,6 @@ defmodule PlausibleWeb.Live.RegisterFormTest do
type_into_input(lv, "user[name]", "Mary Sue")
type_into_input(lv, "user[email]", "mary.sue@plausible.test")
type_into_input(lv, "user[password]", "very-long-and-very-secret-123")
- type_into_input(lv, "user[password_confirmation]", "very-long-and-very-secret-123")
html = lv |> element("form") |> render_submit()
@@ -71,8 +65,7 @@ defmodule PlausibleWeb.Live.RegisterFormTest do
action_input,
name_input,
email_input,
- password_input,
- password_confirmation_input | _
+ password_input | _
] = find(html, "input") |> Enum.into([])
assert String.length(text_of_attr(csrf_input, "value")) > 0
@@ -80,7 +73,6 @@ defmodule PlausibleWeb.Live.RegisterFormTest do
assert text_of_attr(name_input, "value") == "Mary Sue"
assert text_of_attr(email_input, "value") == "mary.sue@plausible.test"
assert text_of_attr(password_input, "value") == "very-long-and-very-secret-123"
- assert text_of_attr(password_confirmation_input, "value") == "very-long-and-very-secret-123"
assert %{
name: "Mary Sue",
@@ -91,22 +83,6 @@ defmodule PlausibleWeb.Live.RegisterFormTest do
assert String.length(password_hash) > 0
end
- test "renders only one error on empty password confirmation", %{conn: conn} do
- mock_captcha_success()
-
- lv = get_liveview(conn, "/register")
-
- type_into_input(lv, "user[name]", "Mary Sue")
- type_into_input(lv, "user[email]", "mary.sue@plausible.test")
- type_into_input(lv, "user[password]", "very-long-and-very-secret-123")
- type_into_input(lv, "user[password_confirmation]", "")
-
- html = lv |> element("form") |> render_submit()
-
- assert html =~ "does not match confirmation"
- refute html =~ "can't be blank"
- end
-
test "renders error on failed captcha", %{conn: conn} do
mock_captcha_failure()
@@ -115,7 +91,6 @@ defmodule PlausibleWeb.Live.RegisterFormTest do
type_into_input(lv, "user[name]", "Mary Sue")
type_into_input(lv, "user[email]", "mary.sue@plausible.test")
type_into_input(lv, "user[password]", "very-long-and-very-secret-123")
- type_into_input(lv, "user[password_confirmation]", "very-long-and-very-secret-123")
html = lv |> element("form") |> render_submit()
@@ -153,7 +128,6 @@ defmodule PlausibleWeb.Live.RegisterFormTest do
type_into_input(lv, "user[name]", "Mary Sue")
type_into_input(lv, "user[password]", "very-long-and-very-secret-123")
- type_into_input(lv, "user[password_confirmation]", "very-long-and-very-secret-123")
html = lv |> element("form") |> render_submit()
@@ -166,8 +140,7 @@ defmodule PlausibleWeb.Live.RegisterFormTest do
action_input,
email_input,
name_input,
- password_input,
- password_confirmation_input | _
+ password_input | _
] = find(html, "input") |> Enum.into([])
assert String.length(text_of_attr(csrf_input, "value")) > 0
@@ -175,7 +148,6 @@ defmodule PlausibleWeb.Live.RegisterFormTest do
assert text_of_attr(name_input, "value") == "Mary Sue"
assert text_of_attr(email_input, "value") == "user@email.co"
assert text_of_attr(password_input, "value") == "very-long-and-very-secret-123"
- assert text_of_attr(password_confirmation_input, "value") == "very-long-and-very-secret-123"
assert user =
%{
@@ -201,7 +173,6 @@ defmodule PlausibleWeb.Live.RegisterFormTest do
type_into_input(lv, "user[name]", "Mary Sue")
type_into_input(lv, "user[password]", "very-long-and-very-secret-123")
- type_into_input(lv, "user[password_confirmation]", "very-long-and-very-secret-123")
html = lv |> element("form") |> render_submit()
@@ -215,8 +186,7 @@ defmodule PlausibleWeb.Live.RegisterFormTest do
team_input,
email_input,
name_input,
- password_input,
- password_confirmation_input | _
+ password_input | _
] = find(html, "input") |> Enum.into([])
assert String.length(text_of_attr(csrf_input, "value")) > 0
@@ -225,7 +195,6 @@ defmodule PlausibleWeb.Live.RegisterFormTest do
assert text_of_attr(name_input, "value") == "Mary Sue"
assert text_of_attr(email_input, "value") == "team-user@email.co"
assert text_of_attr(password_input, "value") == "very-long-and-very-secret-123"
- assert text_of_attr(password_confirmation_input, "value") == "very-long-and-very-secret-123"
end
test "preserves trial_expiry_date when invitation role is :owner", %{
@@ -241,7 +210,6 @@ defmodule PlausibleWeb.Live.RegisterFormTest do
type_into_input(lv, "user[name]", "Mary Sue")
type_into_input(lv, "user[password]", "very-long-and-very-secret-123")
- type_into_input(lv, "user[password_confirmation]", "very-long-and-very-secret-123")
_html = lv |> element("form") |> render_submit()
@@ -261,7 +229,6 @@ defmodule PlausibleWeb.Live.RegisterFormTest do
type_into_input(lv, "user[name]", "Mary Sue")
type_into_input(lv, "user[email]", "mary.sue@plausible.test")
type_into_input(lv, "user[password]", "very-long-and-very-secret-123")
- type_into_input(lv, "user[password_confirmation]", "very-long-and-very-secret-123")
html = lv |> element("form") |> render_submit()
@@ -283,7 +250,7 @@ defmodule PlausibleWeb.Live.RegisterFormTest do
html = render(lv)
- assert html =~ "Your invitation has expired or been revoked"
+ assert html =~ "This invitation has expired or was revoked"
end
test "renders error on failed captcha", %{conn: conn, guest_invitation: guest_invitation} do
@@ -293,7 +260,6 @@ defmodule PlausibleWeb.Live.RegisterFormTest do
type_into_input(lv, "user[name]", "Mary Sue")
type_into_input(lv, "user[password]", "very-long-and-very-secret-123")
- type_into_input(lv, "user[password_confirmation]", "very-long-and-very-secret-123")
html = lv |> element("form") |> render_submit()
diff --git a/test/plausible_web/user_auth_test.exs b/test/plausible_web/user_auth_test.exs
index 2ff543613cfd..657c23edab5b 100644
--- a/test/plausible_web/user_auth_test.exs
+++ b/test/plausible_web/user_auth_test.exs
@@ -146,7 +146,8 @@ defmodule PlausibleWeb.UserAuthTest do
assert redirected_to(conn, 302) == Routes.sso_path(conn, :login_form, return_to: "")
- assert Phoenix.Flash.get(conn.assigns.flash, :login_error) == "Wrong email."
+ assert Phoenix.Flash.get(conn.assigns.flash, :login_error) ==
+ "We couldn't find a Single Sign-On account for that email."
assert conn.private[:plug_session_info] == :renew
refute get_session(conn, :user_token)