W12 family names keep their accents, login made without them; W9 banner link colour; W10 recovery-code page one plain line; W11/W24 remote page hides provider login and key fields behind Haladó; unreleased
gates / gates (push) Successful in 1m33s
gates / gates (push) Successful in 1m33s
This commit is contained in:
1 parent
37b79caad9
commit
8c1e290f63
33 files changed
+1278
-93
No files matched your search
@@ -369,7 +369,7 @@ func TestFamilyGate_CardActsAndNoPasswordInThePage(t *testing.T) {
|
||||
if w := act("add", "anna"); w.Code != http.StatusConflict {
|
||||
t.Fatalf("duplicate: %d", w.Code)
|
||||
}
|
||||
if w := act("add", "Not Valid"); w.Code != http.StatusBadRequest {
|
||||
if w := act("add", "!!!"); w.Code != http.StatusBadRequest { // W12: „Not Valid" is a name now (login not.valid)
|
||||
t.Fatalf("bad name: %d", w.Code)
|
||||
}
|
||||
if w := act("remove", "anna"); w.Code != http.StatusOK || strings.Contains(w.Body.String(), "password") {
|
||||
@@ -379,3 +379,37 @@ func TestFamilyGate_CardActsAndNoPasswordInThePage(t *testing.T) {
|
||||
t.Fatalf("reset of a removed member: %d", w.Code)
|
||||
}
|
||||
}
|
||||
|
||||
// W12 (rehearsal 2026-10-20): the card takes „Ödön" as typed, answers the login made from it (odon) and lists both;
|
||||
// a second name that makes the same login gets odon2; the member may sign in typing „Ödön" or „odon".
|
||||
func TestW12_CardTakesAccentedNamesAndShowsTheLogin(t *testing.T) {
|
||||
s, st := familyHarness(t)
|
||||
add := func(name string) *httptest.ResponseRecorder {
|
||||
r := httptest.NewRequest(http.MethodPost, "/family/members/add", strings.NewReader(url.Values{"name": {name}}.Encode()))
|
||||
r.Header.Set("Content-Type", "application/x-www-form-urlencoded")
|
||||
w := httptest.NewRecorder()
|
||||
s.familyMemberActionHandler(w, r, "add")
|
||||
return w
|
||||
}
|
||||
w := add("Ödön")
|
||||
body := w.Body.String()
|
||||
m := regexp.MustCompile(`"password":"([a-z0-9-]{19})"`).FindStringSubmatch(body)
|
||||
if w.Code != http.StatusOK || m == nil || !strings.Contains(body, `"name":"odon"`) ||
|
||||
!strings.Contains(body, `{"login":"odon","display":"Ödön"}`) || !st.Verify("odon", m[1]) {
|
||||
t.Fatalf("add Ödön: %d %s", w.Code, body)
|
||||
}
|
||||
if w := add("Odon"); w.Code != http.StatusOK || !strings.Contains(w.Body.String(), `"name":"odon2"`) {
|
||||
t.Fatalf("the second odon: %d %s", w.Code, w.Body.String())
|
||||
}
|
||||
for _, typed := range []string{"Ödön", "odon", " ÖDÖN "} {
|
||||
if w := famLogin(s, "203.0.113.20", typed, m[1], ""); famCookie(w, familySessionCookie) == nil {
|
||||
t.Fatalf("sign-in typing %q: %d", typed, w.Code)
|
||||
}
|
||||
}
|
||||
r := httptest.NewRequest(http.MethodGet, "/family/members", nil)
|
||||
lw := httptest.NewRecorder()
|
||||
s.familyMembersHandler(lw, r)
|
||||
if !strings.Contains(lw.Body.String(), `{"login":"odon2","display":"Odon"}`) {
|
||||
t.Fatalf("the list: %s", lw.Body.String())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user