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

Unified Diff: test/paper_radio_group_basic_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/paper_radio_button_behavior_test.html ('k') | test/paper_ripple_behavior_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/paper_radio_group_basic_test.dart
diff --git a/test/paper_radio_group_basic_test.dart b/test/paper_radio_group_basic_test.dart
index 9764b9d22f39dbc4c38d61236dea87e5117e08f9..ec0bae763bfeb4d8b87eca7137df27e3f6eab71f 100644
--- a/test/paper_radio_group_basic_test.dart
+++ b/test/paper_radio_group_basic_test.dart
@@ -16,6 +16,7 @@ main() async {
group('defaults', () {
var LEFT_ARROW = 37;
var RIGHT_ARROW = 39;
+
test('group can have no selection', () {
PaperRadioGroup g = fixture('NoSelection');
expect(g.selected, isNull);
@@ -25,6 +26,7 @@ main() async {
expect(items[1].checked, isFalse);
expect(items[2].checked, isFalse);
});
+
test('group can have a selection', () {
PaperRadioGroup g = fixture('WithSelection');
expect(g.selected, isNotNull);
@@ -104,11 +106,28 @@ main() async {
tap(items[0]);
// The selection should not change, but wait for a little bit just
// in case it would and an event would be fired.
- await wait(200);
+ await wait(1);
expect(items[0].checked, isTrue);
expect(items[1].checked, isFalse);
expect(items[2].checked, isFalse);
});
+
+ test('clicking the selected item should deselect if allow-empty-selection is set', () async {
+ var g = fixture('WithSelection');
+ g.allowEmptySelection = true;
+ var items = g.items;
+
+ expect(items[0].checked, true);
+ tap(items[0]);
+
+ // The selection should not change, but wait for a little bit just
+ // in case it would and an event would be fired.
+ await wait(1);
+
+ expect(items[0].checked, false);
+ expect(items[1].checked, false);
+ expect(items[2].checked, false);
+ });
});
}
« no previous file with comments | « test/paper_radio_button_behavior_test.html ('k') | test/paper_ripple_behavior_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698