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

+26
View File
@@ -83,3 +83,29 @@ func TestPromptComposerSnapshot(t *testing.T) {
})
})
}
func TestPromptComposerCompositionDoesNotSend(t *testing.T) {
text, sends := "draft", 0
composing := false
tt := ui.NewTester(func(c *ui.Context) {
Use(c, Settings{})
if PromptComposer(c, &text, PromptComposerOptions{Label: "Prompt", Composing: composing}).Submitted() {
sends++
}
}, 500, 400)
_ = tt.Click("Prompt")
composing = true
tt.Frame()
tt.Compose("邀请", 2)
tt.Key(0, ui.KeyEnter)
if sends != 0 || text != "draft" {
t.Fatalf("composition submitted: sends %d text %q", sends, text)
}
tt.Type("邀请")
composing = false
tt.Frame()
tt.Key(0, ui.KeyEnter)
if sends != 1 || text != "draft邀请" {
t.Fatalf("committed input: sends %d text %q", sends, text)
}
}