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

Unified Diff: test/iron_selector_multi_test.dart

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 | « test/iron_selector_exclude_local_names_test.dart ('k') | test/iron_selector_multi_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/iron_selector_multi_test.dart
diff --git a/test/iron_selector_multi_test.dart b/test/iron_selector_multi_test.dart
index 3e1c7d2414181fb45475b5543e56d7ba4a32949c..6c689f29217e0137d1dacc1b0314a0fae28180f6 100644
--- a/test/iron_selector_multi_test.dart
+++ b/test/iron_selector_multi_test.dart
@@ -5,6 +5,7 @@
library polymer_elements.test.iron_selector_multi_test;
import 'dart:html';
+import 'package:polymer_interop/polymer_interop.dart';
import 'package:polymer_elements/iron_selector.dart';
import 'package:test/test.dart';
import 'package:web_components/web_components.dart';
@@ -81,6 +82,37 @@ main() async {
expect(selectEventCounter, 1);
expect(deselectEventCounter, 1);
});
+
+ test('fires selected-values-changed when selection changes', () {
+ var selectedValuesChangedEventCounter = 0;
+
+ s.on['selected-values-changed'].listen((e) {
+ selectedValuesChangedEventCounter++;
+ });
+
+ tap(Polymer.dom(s).children[0]);
+ tap(Polymer.dom(s).children[0]);
+ tap(Polymer.dom(s).children[0]);
+
+ expect(selectedValuesChangedEventCounter, isNot(0));
+ });
+
+ test('selects from items created by dom-repeat', () async {
+ var selectEventCounter = 0;
+ var firstChild;
+
+ s = document.querySelector('#repeatedItems');
+ s.on['iron-select'].first.then((e) {
+ selectEventCounter++;
+ });
+
+ // NOTE(cdata): I guess `dom-repeat` doesn't stamp synchronously..
+ await wait(1);
+ firstChild = Polymer.dom(s).querySelector('div');
+ tap(firstChild);
+
+ expect(s.selectedItems[0].text, 'foo');
+ });
/* test('toggle multi from true to false', () {
// set selected
« no previous file with comments | « test/iron_selector_exclude_local_names_test.dart ('k') | test/iron_selector_multi_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698