Skip to content

Commit

Permalink
move from old to generated code for text actions
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMSchmidt committed Sep 28, 2017
1 parent 6be2f80 commit e27aaf5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions detox/src/ios/expect.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,21 @@ class MultiTapAction extends Action {
class TypeTextAction extends Action {
constructor(value) {
super();
if (typeof value !== 'string') throw new Error(`TypeTextAction ctor argument must be a string, got ${typeof value}`);
this._call = invoke.call(invoke.IOS.Class('GREYActions'), 'actionForTypeText:', value);
this._call = invoke.callDirectly(GreyActions.actionForTypeText(value));
}
}

class ReplaceTextAction extends Action {
constructor(value) {
super();
if (typeof value !== 'string') throw new Error(`ReplaceTextAction ctor argument must be a string, got ${typeof value}`);
this._call = invoke.call(invoke.IOS.Class('GREYActions'), 'actionForReplaceText:', value);
this._call = invoke.callDirectly(GreyActions.actionForReplaceText(value));
}
}

class ClearTextAction extends Action {
constructor() {
super();
this._call = invoke.call(invoke.IOS.Class('GREYActions'), 'actionForClearText');
this._call = invoke.callDirectly(GreyActions.actionForClearText());
}
}

Expand Down

0 comments on commit e27aaf5

Please sign in to comment.