@@ -19,8 +19,11 @@ import {
1919 waitFor as dtlWaitFor ,
2020 waitForElementToBeRemoved as dtlWaitForElementToBeRemoved ,
2121 screen as dtlScreen ,
22+ within as dtlWithin ,
2223 waitForOptions as dtlWaitForOptions ,
2324 configure as dtlConfigure ,
25+ getQueriesForElement ,
26+ Queries ,
2427} from '@testing-library/dom' ;
2528import { RenderComponentOptions , RenderDirectiveOptions , RenderTemplateOptions , RenderResult } from './models' ;
2629import { getConfig } from './config' ;
@@ -432,6 +435,14 @@ function detectChangesForMountedFixtures() {
432435 */
433436const screen = replaceFindWithFindAndDetectChanges ( dtlScreen ) ;
434437
438+ /**
439+ * Re-export within with patched queries
440+ */
441+ function within ( element : HTMLElement , queriesToBind ?: Queries ) {
442+ const container = dtlWithin ( element , queriesToBind ) ;
443+ return replaceFindWithFindAndDetectChanges ( container ) ;
444+ }
445+
435446/**
436447 * Re-export waitFor with patched waitFor
437448 */
@@ -516,8 +527,7 @@ export {
516527 queryAllByAttribute ,
517528 queryByAttribute ,
518529 queryHelpers ,
519- within ,
520530} from '@testing-library/dom' ;
521531
522532// export patched dtl
523- export { screen , waitFor , waitForElementToBeRemoved } ;
533+ export { screen , waitFor , waitForElementToBeRemoved , within } ;
0 commit comments