From 51c4f333d71e39eace87df4715c6fb8b6e223fc6 Mon Sep 17 00:00:00 2001 From: Peter Minarik Date: Fri, 6 Oct 2017 18:03:13 +0200 Subject: [PATCH] Fix Android atIndex matcher by fixing typo (#321) --- detox/src/android/expect.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/detox/src/android/expect.js b/detox/src/android/expect.js index 8168262e6f..80e80cf875 100644 --- a/detox/src/android/expect.js +++ b/detox/src/android/expect.js @@ -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 } @@ -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; }