Skip to content

Commit

Permalink
Fix Android atIndex matcher by fixing typo (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
pietropizzi authored and rotemmiz committed Oct 6, 2017
1 parent eeb58d1 commit 51c4f33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions detox/src/android/expect.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class MatcherAssertionInteraction extends Interaction {
super();
//if (!(element instanceof Element)) throw new Error(`MatcherAssertionInteraction ctor 1st argument must be a valid Element, got ${typeof element}`);
//if (!(matcher instanceof Matcher)) throw new Error(`MatcherAssertionInteraction ctor 2nd argument must be a valid Matcher, got ${typeof matcher}`);
// this._call = invoke.call(element._call, 'check', invoke.call(invoke.Android.Class(ViewAssertions), 'matches', matcher._call));
// this._call = invoke.call(element._call, 'check', invoke.call(invoke.Android.Class(ViewAssertions), 'matches', matcher._call));
this._call = invoke.call(invoke.Android.Class(DetoxAssertion), 'assertMatcher', element._call, matcher._call);
// TODO: move this.execute() here from the caller
}
Expand Down Expand Up @@ -218,7 +218,7 @@ class Element {
atIndex(index) {
if (typeof index !== 'number') throw new Error(`Element atIndex argument must be a number, got ${typeof index}`);
const matcher = this._originalMatcher;
this._originalMatcher._call = invoke.call(invoke.Android.Class(DetoxMatcher), 'matherForAtIndex', invoke.Android.Integer(index), matcher._call);
this._originalMatcher._call = invoke.call(invoke.Android.Class(DetoxMatcher), 'matcherForAtIndex', invoke.Android.Integer(index), matcher._call);
this._selectElementWithMatcher(this._originalMatcher);
return this;
}
Expand Down

1 comment on commit 51c4f33

@simonracz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

Err...so we don't have test for this? Oops. :)

Please sign in to comment.