From 63859d491c6845ebd6696064472dbf26e0e5d5fd Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Thu, 28 Sep 2017 18:27:04 +0200 Subject: [PATCH] move from old to generated code for scroll amount action --- detox/src/ios/expect.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/detox/src/ios/expect.js b/detox/src/ios/expect.js index 5470418564..d00d121bf8 100644 --- a/detox/src/ios/expect.js +++ b/detox/src/ios/expect.js @@ -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)); } }