Skip to content

Commit b3697ac

Browse files
authored
fix: add custom queries to render result
1 parent 1f88c41 commit b3697ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: projects/testing-library/src/lib/testing-library.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,12 @@ class WrapperComponent {}
318318
function replaceFindWithFindAndDetectChanges<T>(container: HTMLElement, originalQueriesForContainer: T): T {
319319
return Object.keys(originalQueriesForContainer).reduce((newQueries, key) => {
320320
if (key.startsWith('find')) {
321-
const getByQuery = dtlQueries[key.replace('find', 'get')];
321+
const getByQuery = originalQueriesForContainer[key.replace('find', 'get')];
322322
newQueries[key] = async (text, options, waitOptions) => {
323323
// original implementation at https://github.com/testing-library/dom-testing-library/blob/master/src/query-helpers.js
324324
const result = await waitForWrapper(
325325
detectChangesForMountedFixtures,
326-
() => getByQuery(container, text, options),
326+
() => getByQuery(text, options),
327327
waitOptions,
328328
);
329329
return result;

0 commit comments

Comments
 (0)