feat(ioscompanion): expose native typing with an explicit replace flag

This commit is contained in:
pj committed 2026-06-07 16:43:46 +05:30
1 parent a6052c6745
commit ee198d15de
3 files changed
+32 -1

No files matched your search

@@ -467,3 +467,22 @@ func TestResponseIDMismatchIsSentinel(t *testing.T) {
t.Fatalf("id mismatch must wrap the sentinel: %v", err)
}
}
func TestTypeTextAppendsWithoutReplace(t *testing.T) {
server := startFakeServer(t, nil)
companion := dialFake(t, server, "com.example.app")
typer := companion.(TextTyper)
if err := typer.TypeText(context.Background(), "héllo 🌟", false); err != nil {
t.Fatalf("TypeText: %v", err)
}
requests := server.recorded()
if len(requests) != 1 {
t.Fatalf("recorded %d requests, want 1", len(requests))
}
request := requests[0]
if request.Method != "typeText" || request.Params["text"] != "héllo 🌟" || request.Params["replace"] != false {
t.Fatalf("typeText request = %+v", request)
}
}