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 @@ -222,6 +222,23 @@ describe('HTML Parser', function () {
222
222
223
223
} ) ;
224
224
225
+ describe ( '#querySelector()' , function ( ) {
226
+
227
+ it ( 'should return correct elements in DOM tree' , function ( ) {
228
+
229
+ var root = parseHTML ( '<a id="id"><div><span class="a b"></span><span></span><span></span></div></a>' ) ;
230
+
231
+ root . querySelector ( '#id' ) . should . eql ( root . firstChild ) ;
232
+ root . querySelector ( 'span.a' ) . should . eql ( root . firstChild . firstChild . firstChild ) ;
233
+ root . querySelector ( 'span.b' ) . should . eql ( root . firstChild . firstChild . firstChild ) ;
234
+ root . querySelector ( 'span.a.b' ) . should . eql ( root . firstChild . firstChild . firstChild ) ;
235
+ root . querySelector ( '#id .b' ) . should . eql ( root . firstChild . firstChild . firstChild ) ;
236
+ root . querySelector ( '#id span' ) . should . eql ( root . firstChild . firstChild . firstChild ) ;
237
+
238
+ } ) ;
239
+
240
+ } ) ;
241
+
225
242
describe ( '#querySelectorAll()' , function ( ) {
226
243
227
244
it ( 'should return correct elements in DOM tree' , function ( ) {
You can’t perform that action at this time.
0 commit comments