diff --git a/test/html.js b/test/html.js
index d88394d..2207274 100644
--- a/test/html.js
+++ b/test/html.js
@@ -222,6 +222,23 @@ describe('HTML Parser', function () {
});
+ describe('#querySelector()', function () {
+
+ it('should return correct elements in DOM tree', function () {
+
+ var root = parseHTML('
');
+
+ root.querySelector('#id').should.eql(root.firstChild);
+ root.querySelector('span.a').should.eql(root.firstChild.firstChild.firstChild);
+ root.querySelector('span.b').should.eql(root.firstChild.firstChild.firstChild);
+ root.querySelector('span.a.b').should.eql(root.firstChild.firstChild.firstChild);
+ root.querySelector('#id .b').should.eql(root.firstChild.firstChild.firstChild);
+ root.querySelector('#id span').should.eql(root.firstChild.firstChild.firstChild);
+
+ });
+
+ });
+
describe('#querySelectorAll()', function () {
it('should return correct elements in DOM tree', function () {