Index: lib/src/iron-media-query/test/basic.html |
diff --git a/lib/src/iron-media-query/test/basic.html b/lib/src/iron-media-query/test/basic.html |
index 34346c290dbdea55f54fc45ba14b9311a205aba0..c2db515ddec0a7dc907bfa4441e3afb1c1c7a011 100644 |
--- a/lib/src/iron-media-query/test/basic.html |
+++ b/lib/src/iron-media-query/test/basic.html |
@@ -61,6 +61,42 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
assert.equal(mq.queryMatches, true); |
}); |
+ test('automatically wrap with parens', function() { |
+ mq.query = 'min-width: 1px'; |
+ assert.equal(mq.queryMatches, true); |
+ }); |
+ |
+ suite('query does not activate on empty string or null', function() { |
+ |
+ test('empty string', function() { |
+ mq.query = ''; |
+ assert.notOk(mq._mq); |
+ }); |
+ |
+ test('null', function() { |
+ mq.query = null; |
+ assert.notOk(mq._mq); |
+ }); |
+ |
+ }); |
+ |
+ test('media query destroys on detach', function() { |
+ mq.query = '(max-width: 800px)'; |
+ mq.parentNode.removeChild(mq); |
+ Polymer.dom.flush(); |
+ assert.notOk(mq._mq); |
+ }); |
+ |
+ test('media query re-enables on attach', function() { |
+ mq.query = '(max-width: 800px)'; |
+ var parent = mq.parentNode; |
+ parent.removeChild(mq); |
+ Polymer.dom.flush(); |
+ parent.appendChild(mq); |
+ Polymer.dom.flush(); |
+ assert.ok(mq._mq); |
+ }); |
+ |
}); |
}); |