Forms: review r2 fixes

This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 13:02:54 -04:00
1 parent 215733e3f4
commit ab14eadcd9
21 files changed
+267 -49

No files matched your search

+20
View File
@@ -102,3 +102,23 @@ func TestPinInputSnapshot(t *testing.T) {
})
})
}
func TestPinInputDisabledAfterFocus(t *testing.T) {
p := &pinInputProbe{value: "12"}
opts := PinInputOptions{Label: "Code"}
tt := ui.NewTester(func(c *ui.Context) {
Use(c, Settings{})
r := PinInput(c, &p.value, opts)
if r.Changed() {
p.changes++
}
}, 480, 120)
tt.Key(0, ui.KeyTab)
opts.Disabled = true
tt.Type("3")
tt.Key(0, ui.KeyBackspace)
tt.Frame()
if p.value != "12" || p.changes != 0 {
t.Fatalf("value %q changes %d", p.value, p.changes)
}
}