Index: samples/third_party/todomvc_performance/js_todomvc/components/polymer-selection/test/html/polymer-selection-multi.html |
diff --git a/samples/third_party/todomvc_performance/js_todomvc/components/polymer-selection/test/html/polymer-selection-multi.html b/samples/third_party/todomvc_performance/js_todomvc/components/polymer-selection/test/html/polymer-selection-multi.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ebc02f6b4ea881349854426ed891fd11b96817ac |
--- /dev/null |
+++ b/samples/third_party/todomvc_performance/js_todomvc/components/polymer-selection/test/html/polymer-selection-multi.html |
@@ -0,0 +1,43 @@ |
+<!doctype html> |
+<html> |
+<head> |
+ <title>polymer-selection-multi</title> |
+ <script src="../../../platform/platform.js"></script> |
+ <script src="../../../tools/test/htmltest.js"></script> |
+ <script src="../../../tools/test/chai/chai.js"></script> |
+ <link rel="import" href="../../polymer-selection.html"> |
+</head> |
+<body> |
+ |
+ <polymer-selection multi></polymer-selection> |
+ |
+ <script> |
+ var assert = chai.assert; |
+ document.addEventListener('polymer-ready', function() { |
+ var s = document.querySelector('polymer-selection'); |
+ s.addEventListener("polymer-select", function(event) { |
+ if (test === 1) { |
+ // check test1 |
+ assert.isTrue(event.detail.isSelected); |
+ assert.equal(event.detail.item, '(item1)'); |
+ assert.isTrue(s.isSelected(event.detail.item)); |
+ assert.equal(s.getSelection().length, 1); |
+ // test2 |
+ test++; |
+ s.select('(item2)'); |
+ } else if (test === 2) { |
+ // check test2 |
+ assert.isTrue(event.detail.isSelected); |
+ assert.equal(event.detail.item, '(item2)'); |
+ assert.isTrue(s.isSelected(event.detail.item)); |
+ assert.equal(s.getSelection().length, 2); |
+ done(); |
+ } |
+ }); |
+ // test1 |
+ var test = 1; |
+ s.select('(item1)'); |
+ }); |
+ </script> |
+</body> |
+</html> |