Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: lib/src/iron-media-query/test/basic.html

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/iron-media-query/iron-media-query.html ('k') | lib/src/iron-meta/iron-meta.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ });
+
});
});
« no previous file with comments | « lib/src/iron-media-query/iron-media-query.html ('k') | lib/src/iron-meta/iron-meta.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698