test(ioscompanion): cover paste threshold, retry flow, and sentinel detection

This commit is contained in:
pj committed 2026-06-07 00:28:40 +05:30
1 parent 841497cc30
commit a15e7a14f9
2 files changed
+45 -1

No files matched your search

@@ -222,3 +222,24 @@ func TestRootIsFlatWithAllChildren(t *testing.T) {
t.Fatalf("root bounds = %+v, want %+v", tree.Root.Bounds, wantRoot)
}
}
func TestHasUnresolvedValues(t *testing.T) {
cases := []struct {
name string
dump string
want bool
}{
{name: "sentinel value", dump: `[{"type":"TextField","AXValue":"Invalid","frame":{"x":0,"y":0,"width":1,"height":1}}]`, want: true},
{name: "clean values", dump: `[{"type":"TextField","AXValue":"hello","frame":{"x":0,"y":0,"width":1,"height":1}}]`, want: false},
{name: "empty value", dump: `[{"type":"TextField","AXValue":"","frame":{"x":0,"y":0,"width":1,"height":1}}]`, want: false},
{name: "empty dump", dump: `[]`, want: false},
{name: "malformed dump", dump: `nope`, want: false},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
if got := hasUnresolvedValues([]byte(c.dump)); got != c.want {
t.Fatalf("got %v, want %v", got, c.want)
}
})
}
}