File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,23 @@ describe('lib/extend.ts', () => {
82
82
expect ( text ) . toEqual ( [ 'Hello h1' , 'Hello h2' , 'Hello h3' ] )
83
83
} )
84
84
85
+ it ( 'should handle the queryAll* methods with a selector' , async ( ) => {
86
+ const elements = await document . queryAllByText ( / H e l l o / , { selector : 'h2' } )
87
+ expect ( elements ) . toHaveLength ( 1 )
88
+
89
+ const text = await page . evaluate ( el => el . textContent , elements [ 0 ] )
90
+
91
+ expect ( text ) . toEqual ( 'Hello h2' )
92
+ } )
93
+
94
+ it ( 'should handle the getBy* methods with a selector' , async ( ) => {
95
+ const element = await document . getByText ( / H e l l o / , { selector : 'h2' } )
96
+
97
+ const text = await page . evaluate ( el => el . textContent , element )
98
+
99
+ expect ( text ) . toEqual ( 'Hello h2' )
100
+ } )
101
+
85
102
it ( 'should scope results to element' , async ( ) => {
86
103
const scope = await document . $ ( '#scoped' )
87
104
const element = await scope ! . queryByText ( / H e l l o / )
You can’t perform that action at this time.
0 commit comments