Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroll Amount Action: Move to generated code #298

Merged
merged 1 commit into from
Sep 29, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions detox/src/ios/expect.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,7 @@ class ClearTextAction extends Action {
class ScrollAmountAction extends Action {
constructor(direction, amount) {
super();
if (typeof direction !== 'string') throw new Error(`ScrollAmountAction ctor 1st argument must be a string, got ${typeof direction}`);
switch (direction) {
case 'left': direction = 1; break;
case 'right': direction = 2; break;
case 'up': direction = 3; break;
case 'down': direction = 4; break;
default: throw new Error(`ScrollAmountAction direction must be a 'left'/'right'/'up'/'down', got ${direction}`);
}
if (typeof amount !== 'number') throw new Error(`ScrollAmountAction ctor 2nd argument must be a number, got ${typeof amount}`);
this._call = invoke.call(invoke.IOS.Class('GREYActions'), 'actionForScrollInDirection:amount:', invoke.IOS.NSInteger(direction), invoke.IOS.CGFloat(amount));
this._call = invoke.callDirectly(GreyActions.actionForScrollInDirectionAmount(direction, amount));
}
}

Expand Down