mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-05 04:27:09 +00:00
test(ioscompanion): cover paste threshold, retry flow, and sentinel detection
This commit is contained in:
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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user