diff --git a/internal/verifier/marshal.go b/internal/verifier/marshal.go index ff40d9e..cfac347 100644 --- a/internal/verifier/marshal.go +++ b/internal/verifier/marshal.go @@ -464,6 +464,7 @@ func DecodeAction(raw json.RawMessage) (Action, error) { case "Scroll": return Action{ Kind: ActionKindScroll, + On: wire.Selector, Direction: wire.Direction, FromX: wire.FromX, FromY: wire.FromY, diff --git a/internal/verifier/marshal_test.go b/internal/verifier/marshal_test.go index 6013faa..fa9085c 100644 --- a/internal/verifier/marshal_test.go +++ b/internal/verifier/marshal_test.go @@ -47,6 +47,13 @@ func TestDecodeAction_AllKinds(t *testing.T) { raw: `{"kind":"Scroll","direction":"down","fromX":1,"fromY":2,"toX":3,"toY":4,"durationMillis":100}`, want: Action{Kind: ActionKindScroll, Direction: "down", FromX: 1, FromY: 2, ToX: 3, ToY: 4, DurationMillis: 100}, }, + { + // An author names the container and leaves the drag to the runner, + // which needs the selector to size it against the right bounds. + name: "Scroll with a container and no endpoints", + raw: `{"kind":"Scroll","direction":"up","selector":"id:list","fromX":0,"fromY":0,"toX":0,"toY":0,"durationMillis":250}`, + want: Action{Kind: ActionKindScroll, On: "id:list", Direction: "up", DurationMillis: 250}, + }, { name: "PressKey", raw: `{"kind":"PressKey","key":"back"}`,