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

Unified Diff: polymer_1.2.3/bower_components/iron-selector/test/basic.html

Issue 1581713003: [third_party] add polymer 1.2.3 (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: 1.2.3 Created 4 years, 11 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
Index: polymer_1.2.3/bower_components/iron-selector/test/basic.html
diff --git a/polymer_1.0.4/bower_components/iron-selector/test/basic.html b/polymer_1.2.3/bower_components/iron-selector/test/basic.html
similarity index 70%
copy from polymer_1.0.4/bower_components/iron-selector/test/basic.html
copy to polymer_1.2.3/bower_components/iron-selector/test/basic.html
index 602de183f85ddb32f9f01025350fcb9c3465119d..5a6da48254c750431b9a24ef7f5192fc807e1743 100644
--- a/polymer_1.0.4/bower_components/iron-selector/test/basic.html
+++ b/polymer_1.2.3/bower_components/iron-selector/test/basic.html
@@ -104,10 +104,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
s2 = fixture('basic');
});
- test('honors the attrForSelected attribute', function() {
- assert.equal(s2.attrForSelected, 'id');
- assert.equal(s2.selected, 'item2');
- assert.equal(s2.selectedItem, document.querySelector('#item2'));
+ test('honors the attrForSelected attribute', function(done) {
+ Polymer.Base.async(function() {
+ assert.equal(s2.attrForSelected, 'id');
+ assert.equal(s2.selected, 'item2');
+ assert.equal(s2.selectedItem, document.querySelector('#item2'));
+ done();
+ });
});
test('allows assignment to selected', function() {
@@ -142,6 +145,48 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
assert.equal(selectedEventCounter, 0);
});
+ suite('items changing', function() {
+ test('cause iron-items-changed to fire', function(done) {
+ var newItem = document.createElement('div');
+ var changeCount = 0;
+
+ newItem.id = 'item999';
+
+ s2.addEventListener('iron-items-changed', function() {
+ changeCount++;
+ });
+
+ Polymer.dom(s2).appendChild(newItem);
+
+ Polymer.Base.async(function() {
+ Polymer.dom(s2).removeChild(newItem);
+
+ Polymer.Base.async(function() {
+ expect(changeCount).to.be.equal(2);
+ done();
+ }, 1);
+ }, 1);
+ });
+ });
+
+ suite('dynamic selector', function() {
+ test('selects dynamically added child automatically', function(done) {
+ var selector = document.createElement('iron-selector');
+ var child = document.createElement('div');
+
+ selector.selected = '0';
+ child.textContent = 'Item 0';
+
+ Polymer.dom(selector).appendChild(child);
+ document.body.appendChild(selector);
+
+ Polymer.Base.async(function() {
+ assert.equal(child.className, 'iron-selected');
+ document.body.removeChild(selector);
+ done();
+ }, 1);
+ });
+ });
});
</script>

Powered by Google App Engine
This is Rietveld 408576698