Gallery test: wait for the visible overlay; no password in failure output

This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 14:05:37 -04:00
1 parent f9c0a5b558
commit d0082ba047
1 file changed
+5 -5
+5 -5
View File
@@ -111,11 +111,11 @@ func TestCompositeFormInvalidThenValid(t *testing.T) {
click(t, tt, "I accept the covenant of the masquerade") click(t, tt, "I accept the covenant of the masquerade")
if s.name != "Mortis" || s.password != "hunter22secret" || s.debut.Format("2006-01-02") != "2026-12-24" || if s.name != "Mortis" || s.password != "hunter22secret" || s.debut.Format("2006-01-02") != "2026-12-24" ||
!slices.Equal(s.tags, []string{"guitar"}) || !s.terms { !slices.Equal(s.tags, []string{"guitar"}) || !s.terms {
t.Fatalf("values %q %q %v %q %v", s.name, s.password, s.debut, s.tags, s.terms) t.Fatalf("values %q, password ok %v, %v %q %v", s.name, s.password == "hunter22secret", s.debut, s.tags, s.terms)
} }
click(t, tt, "Submit entry") click(t, tt, "Submit entry")
await(tt, s.st.Submitting) // the name check finishes first await(tt, func() bool { return tt.HasText("Submitting…") }) // the name check finishes first
if !s.st.Submitting() || !tt.HasText("Submitting…") { if !s.st.Submitting() {
t.Fatalf("no loading overlay in %q", tt.Texts()) t.Fatalf("no loading overlay in %q", tt.Texts())
} }
click(t, tt, "Submit entry") // the overlay blocks a second submit click(t, tt, "Submit entry") // the overlay blocks a second submit
@@ -124,9 +124,9 @@ func TestCompositeFormInvalidThenValid(t *testing.T) {
t.Fatalf("phase %d, texts %q", s.phase, tt.Texts()) t.Fatalf("phase %d, texts %q", s.phase, tt.Texts())
} }
submits := 0 submits := 0
for _, e := range g.events { for i, e := range g.events {
if strings.Contains(e.text, "hunter22secret") { if strings.Contains(e.text, "hunter22secret") {
t.Fatalf("password logged: %q", e.text) t.Fatalf("password logged in event %d of page %s", i, e.page)
} }
if e.page == formID && strings.HasPrefix(e.text, "submitted ") { if e.page == formID && strings.HasPrefix(e.text, "submitted ") {
submits++ submits++