@@ -19,8 +19,11 @@ import {
19
19
waitFor as dtlWaitFor ,
20
20
waitForElementToBeRemoved as dtlWaitForElementToBeRemoved ,
21
21
screen as dtlScreen ,
22
+ within as dtlWithin ,
22
23
waitForOptions as dtlWaitForOptions ,
23
24
configure as dtlConfigure ,
25
+ getQueriesForElement ,
26
+ Queries ,
24
27
} from '@testing-library/dom' ;
25
28
import { RenderComponentOptions , RenderDirectiveOptions , RenderTemplateOptions , RenderResult } from './models' ;
26
29
import { getConfig } from './config' ;
@@ -432,6 +435,14 @@ function detectChangesForMountedFixtures() {
432
435
*/
433
436
const screen = replaceFindWithFindAndDetectChanges ( dtlScreen ) ;
434
437
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
+
435
446
/**
436
447
* Re-export waitFor with patched waitFor
437
448
*/
@@ -516,8 +527,7 @@ export {
516
527
queryAllByAttribute ,
517
528
queryByAttribute ,
518
529
queryHelpers ,
519
- within ,
520
530
} from '@testing-library/dom' ;
521
531
522
532
// export patched dtl
523
- export { screen , waitFor , waitForElementToBeRemoved } ;
533
+ export { screen , waitFor , waitForElementToBeRemoved , within } ;
0 commit comments