WIP components (as built)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 15:51:57 -04:00
1 parent a22527cceb
commit ade219840e
70 files changed
+2610 -235

No files matched your search

+20
View File
@@ -58,3 +58,23 @@ func TestContextChipsSnapshot(t *testing.T) {
ui.Column(c).Padding(16).Children(func() { ContextChips(c, mentionSample, ContextChipsOptions{Max: 3}) })
})
}
func TestContextChipsKeyboardAndEmpty(t *testing.T) {
items, removed := mentionSample, ""
tt := ui.NewTester(func(c *ui.Context) {
Use(c, Settings{})
if id, ok := ContextChips(c, items, ContextChipsOptions{Max: 1}).Removed(); ok {
removed = id
}
}, 400, 160)
tt.Key(0, ui.KeyTab)
tt.Key(0, ui.KeyEnter)
if removed != "w1" {
t.Fatalf("removed %q, want w1", removed)
}
items = nil
tt.Frame()
if tt.HasText("+3 more") || tt.HasText("Versailles") {
t.Fatal("empty chips retained content")
}
}