From d39b6653635f47a2a71b8db1ee59a37acaf916e2 Mon Sep 17 00:00:00 2001 From: timdeschryver <28659384+timdeschryver@users.noreply.github.com> Date: Sat, 7 Mar 2020 22:02:12 +0100 Subject: [PATCH] fix: use wait in findBy queries This, to prevent that deprecations will be logged Closes #468 --- src/query-helpers.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/query-helpers.js b/src/query-helpers.js index 3c3295ae..4f0cd8be 100644 --- a/src/query-helpers.js +++ b/src/query-helpers.js @@ -1,5 +1,5 @@ import {fuzzyMatches, matches, makeNormalizer} from './matches' -import {waitForElement} from './wait-for-element' +import {wait} from './wait' import {getConfig} from './config' function getMultipleElementsFoundError(message, container) { @@ -65,13 +65,10 @@ function makeGetAllQuery(allQuery, getMissingError) { } // this accepts a getter query function and returns a function which calls -// waitForElement and passing a function which invokes the getter. +// wait and passing a function which invokes the getter. function makeFindQuery(getter) { - return (container, text, options, waitForElementOptions) => - waitForElement( - () => getter(container, text, options), - waitForElementOptions, - ) + return (container, text, options, waitOptions) => + wait(() => getter(container, text, options), waitOptions) } function buildQueries(queryAllBy, getMultipleError, getMissingError) {