test: use placeholder domains in setup and system-server tests
Three tests carried the maintainer's production root domain, a personal mailbox and the public IP of a live demo host as fixture values. None of them needs the value to be real: the re-domain test only needs two different roots, and the setup flow only needs a well-formed address. Swap them for the placeholders the rest of the suite already uses (mc.example.net, [email protected]), and move the "before" root in the re-domain test to 203.0.113.10.nip.io. That address is from the RFC 5737 documentation range, so the stale install the test models still has an IP-derived hostname, which is the case the refresh exists for.
This commit is contained in:
2 files changed
+8
-8
No files matched your search
@@ -40,16 +40,16 @@ func TestSetupNoSMTPFlow(t *testing.T) {
|
||||
}
|
||||
|
||||
// 2. Record the email — NO OTP. The row is written but email_verified stays false.
|
||||
w := do(h, "POST", "/api/v1/account/email", `{"email":"[email protected]"}`, jsonHeader)
|
||||
w := do(h, "POST", "/api/v1/account/email", `{"email":"[email protected]"}`, jsonHeader)
|
||||
if w.Code != http.StatusOK {
|
||||
t.Fatalf("set-email code = %d, want 200 (%s)", w.Code, w.Body.String())
|
||||
}
|
||||
if u := repo.staff["owner"]; u.Email != "[email protected]" || u.EmailVerified {
|
||||
if u := repo.staff["owner"]; u.Email != "[email protected]" || u.EmailVerified {
|
||||
t.Fatalf("after record: email=%q verified=%v, want the address recorded and UNVERIFIED", u.Email, u.EmailVerified)
|
||||
}
|
||||
|
||||
// 3. Email recorded but no passkey → STILL required (email verification is not the gate).
|
||||
if s := status(t); s["setup_required"] != true || s["email"] != "[email protected]" {
|
||||
if s := status(t); s["setup_required"] != true || s["email"] != "[email protected]" {
|
||||
t.Fatalf("email-only status = %v, want setup_required=true (passkey still missing)", s)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user