@@ -19,8 +19,10 @@ 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
+ Queries ,
24
26
} from '@testing-library/dom' ;
25
27
import { RenderComponentOptions , RenderDirectiveOptions , RenderTemplateOptions , RenderResult } from './models' ;
26
28
import { getConfig } from './config' ;
@@ -432,6 +434,14 @@ function detectChangesForMountedFixtures() {
432
434
*/
433
435
const screen = replaceFindWithFindAndDetectChanges ( dtlScreen ) ;
434
436
437
+ /**
438
+ * Re-export within with patched queries
439
+ */
440
+ function within ( element : HTMLElement , queriesToBind ?: Queries ) {
441
+ const container = dtlWithin ( element , queriesToBind ) ;
442
+ return replaceFindWithFindAndDetectChanges ( container ) ;
443
+ }
444
+
435
445
/**
436
446
* Re-export waitFor with patched waitFor
437
447
*/
@@ -516,8 +526,7 @@ export {
516
526
queryAllByAttribute ,
517
527
queryByAttribute ,
518
528
queryHelpers ,
519
- within ,
520
529
} from '@testing-library/dom' ;
521
530
522
531
// export patched dtl
523
- export { screen , waitFor , waitForElementToBeRemoved } ;
532
+ export { screen , waitFor , waitForElementToBeRemoved , within } ;
0 commit comments