Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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