Skip to content

Commit

Permalink
fix(find*): waitForElement was still in use (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kent C. Dodds authored Mar 12, 2020
1 parent 1b711a4 commit c0a4eb2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/query-helpers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {fuzzyMatches, matches, makeNormalizer} from './matches'
import {waitForElement} from './wait-for-element'
import {waitFor} from './wait-for'
import {getConfig} from './config'

function getMultipleElementsFoundError(message, container) {
Expand Down Expand Up @@ -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.
// waitFor 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, waitForOptions) =>
waitFor(() => getter(container, text, options), waitForOptions)
}

function buildQueries(queryAllBy, getMultipleError, getMissingError) {
Expand Down

0 comments on commit c0a4eb2

Please sign in to comment.