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

Unified Diff: polymer_0.5.0/bower_components/core-selector/test/multi.html

Issue 786953007: npm_modules: Fork bower_components into Polymer 0.4.0 and 0.5.0 versions (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 12 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_0.5.0/bower_components/core-selector/test/multi.html
diff --git a/bower_components/core-selector/test/multi.html b/polymer_0.5.0/bower_components/core-selector/test/multi.html
similarity index 72%
rename from bower_components/core-selector/test/multi.html
rename to polymer_0.5.0/bower_components/core-selector/test/multi.html
index a360d2663feb083672d553e6e034203f92fbbb02..b6b12907240cc29922d6a46d433d40f4f04610c1 100644
--- a/bower_components/core-selector/test/multi.html
+++ b/polymer_0.5.0/bower_components/core-selector/test/multi.html
@@ -12,7 +12,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<meta charset="UTF-8">
<title>core-selector-multi</title>
- <script src="../../platform/platform.js"></script>
+ <script src="../../webcomponentsjs/webcomponents.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<link rel="import" href="../core-selector.html">
@@ -60,8 +60,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
} else {
selectEventCounter--;
}
- // check selectedItem in core-select event
- assert.equal(this.selectedItem.length, selectEventCounter);
});
// set selected
s.selected = [0, 2];
@@ -79,7 +77,32 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
s.children[0].dispatchEvent(new CustomEvent('tap', {bubbles: true}));
// check selected
assert.equal(s.selected.length, 1);
- assert.isFalse(s.children[0].classList.contains('core-selected'));
+ asyncPlatformFlush(function() {
+ assert.equal(selectEventCounter, 1);
+ assert.isFalse(s.children[0].classList.contains('core-selected'));
+ // add selected
+ s.selected.push(3);
+ s.selected.push(4);
+ // check core-select event
+ asyncPlatformFlush(function() {
+ assert.equal(selectEventCounter, 3);
+ done();
+ });
+ });
+ });
+ });
+
+ test('toggle multi to false', function(done) {
+ // set selected
+ s.selected = [0, 2];
+ var first = s.selected[0];
+ // set mutli to false, so to make it single-selection
+ s.multi = false;
+ asyncPlatformFlush(function() {
+ // selected should not be an array
+ assert.isNotArray(s.selected);
+ // selected should be the first value in the old array
+ assert.equal(s.selected, first);
done();
});
});

Powered by Google App Engine
This is Rietveld 408576698