| OLD | NEW |
| 1 library input_element_test; | 1 library input_element_test; |
| 2 import 'package:unittest/unittest.dart'; | 2 import 'package:unittest/unittest.dart'; |
| 3 import 'package:unittest/html_individual_config.dart'; | 3 import 'package:unittest/html_individual_config.dart'; |
| 4 import 'dart:html'; | 4 import 'dart:html'; |
| 5 | 5 |
| 6 void check(InputElement element, String type, [bool supported = true]) { | 6 void check(InputElement element, String type, [bool supported = true]) { |
| 7 expect(element is InputElement, true); | 7 expect(element is InputElement, true); |
| 8 if (supported) { | 8 if (supported) { |
| 9 expect(element.type, type); | 9 expect(element.type, type); |
| 10 } else { | 10 } else { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 } | 136 } |
| 137 }); | 137 }); |
| 138 | 138 |
| 139 test('datetime-local', () { | 139 test('datetime-local', () { |
| 140 check(new LocalDateTimeInputElement(), 'datetime-local', | 140 check(new LocalDateTimeInputElement(), 'datetime-local', |
| 141 LocalDateTimeInputElement.supported); | 141 LocalDateTimeInputElement.supported); |
| 142 }); | 142 }); |
| 143 | 143 |
| 144 test('number', () { | 144 test('number', () { |
| 145 check(new NumberInputElement(), 'number', NumberInputElement.supported); | 145 check(new NumberInputElement(), 'number', NumberInputElement.supported); |
| 146 if (NumberInputElement.supported) { | |
| 147 var element = new NumberInputElement(); | |
| 148 element.value = '123'; | |
| 149 expect(element.valueAsNumber, 123); | |
| 150 } | |
| 151 }); | 146 }); |
| 152 | 147 |
| 153 test('range', () { | 148 test('range', () { |
| 154 check(new RangeInputElement(), 'range', RangeInputElement.supported); | 149 check(new RangeInputElement(), 'range', RangeInputElement.supported); |
| 155 }); | 150 }); |
| 156 | 151 |
| 157 test('checkbox', () { | 152 test('checkbox', () { |
| 158 check(new CheckboxInputElement(), 'checkbox'); | 153 check(new CheckboxInputElement(), 'checkbox'); |
| 159 }); | 154 }); |
| 160 | 155 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 184 }); | 179 }); |
| 185 | 180 |
| 186 group('attributes', () { | 181 group('attributes', () { |
| 187 test('valueSetNull', () { | 182 test('valueSetNull', () { |
| 188 final e = new TextInputElement(); | 183 final e = new TextInputElement(); |
| 189 e.value = null; | 184 e.value = null; |
| 190 expect(e.value, ''); | 185 expect(e.value, ''); |
| 191 }); | 186 }); |
| 192 }); | 187 }); |
| 193 } | 188 } |
| OLD | NEW |