Index: test/data/input/custom_radio_button_test.html |
diff --git a/test/data/input/radio_button_test.html b/test/data/input/custom_radio_button_test.html |
similarity index 74% |
copy from test/data/input/radio_button_test.html |
copy to test/data/input/custom_radio_button_test.html |
index d2cb97f520c246a316f47a3e1b07944f66160508..898541f3ea36fe5716e71f325a75ce865bc3ce9b 100644 |
--- a/test/data/input/radio_button_test.html |
+++ b/test/data/input/custom_radio_button_test.html |
@@ -12,9 +12,27 @@ BSD-style license that can be found in the LICENSE file. |
<script type='application/javascript' src="testing.js"></script> |
</head> |
<body> |
+ <element name="x-my-input" extends="input"> |
+ <template></template> |
+ <script type="application/dart"> |
+ import 'package:web_components/web_components.dart'; |
+ class MyInput extends WebComponent { |
+ int clicked; |
+ created() { |
+ clicked = 0; |
+ } |
+ inserted() { |
+ on.click.add((e) { clicked++; }); |
+ } |
+ } |
+ </script> |
+ </element> |
<form> |
- <input name="a" type="radio" value="Foo" bind-value="name">Foo! |
- <input name="a" type="radio" value="Bar" bind-value="name">Bar! |
+ <!-- TODO(jmesserly): if fix #82 we can use <x-my-input> tags. --> |
+ <input is="x-my-input" name="a" type="radio" value="Foo" bind-value="name"> |
+ Foo! |
+ <input is="x-my-input" name="a" type="radio" value="Bar" bind-value="name"> |
+ Bar! |
</form> |
<pre>You picked {{name}}. Final value should be 'Bar'</pre> |
<script type="application/dart"> |
@@ -49,11 +67,15 @@ BSD-style license that can be found in the LICENSE file. |
expect(bar.checked, false, reason: 'foo picked.'); |
expect(name, 'Foo'); |
+ expect(foo.xtag.clicked, 0); |
+ expect(bar.xtag.clicked, 0); |
bar.on.click.dispatch( |
new MouseEvent('click', window, 1, 0, 0, 0, 0, 0)); |
expect(name, 'Bar', reason: 'bar clicked.'); |
expect(foo.checked, false, reason: 'bar clicked.'); |
expect(bar.checked, true, reason: 'bar clicked.'); |
+ expect(foo.xtag.clicked, 0); |
+ expect(bar.xtag.clicked, 1); |
foo.checked = true; |
expect(bar.checked, false, reason: 'only one can be checked.'); |