WIP components (as built)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 15:51:57 -04:00
1 parent 1095ed2b9d
commit 7e4f275f0a
80 files changed
+2754 -132

No files matched your search

+26
View File
@@ -63,3 +63,29 @@ func TestKeyValueInputSnapshot(t *testing.T) {
ui.Column(c).Padding(16).Children(func() { KeyValueInput(c, &rows, KeyValueInputOptions{}) })
})
}
func TestKeyValueInputManyRows(t *testing.T) {
rows := make([]KeyValue, 100000)
for i := range rows {
rows[i] = KeyValue{Key: "item", Value: "value", Enabled: true}
}
n := 0
tt := kvTester(&rows, KeyValueInputOptions{}, &n)
if got := len(tt.Texts()); got > 500 {
t.Fatalf("built %d texts for 100000 rows", got)
}
}
func TestKeyValueInputAncestorDisabledAndEmpty(t *testing.T) {
var rows []KeyValue
tt := ui.NewTester(func(c *ui.Context) {
Use(c, Settings{})
ui.Column(c).Disabled(true).Children(func() { KeyValueInput(c, &rows, KeyValueInputOptions{}) })
}, 600, 300)
_ = tt.Click("Add row")
tt.Key(0, ui.KeyTab)
tt.Key(0, ui.KeyEnter)
if len(rows) != 0 {
t.Fatal("disabled empty editor changed")
}
}