OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library datalistelement_dataview_test; | |
6 import 'package:unittest/unittest.dart'; | |
7 import 'package:unittest/html_config.dart'; | |
8 import 'dart:html'; | 5 import 'dart:html'; |
9 | 6 |
| 7 import 'package:minitest/minitest.dart'; |
| 8 |
10 main() { | 9 main() { |
11 useHtmlConfiguration(); | |
12 | |
13 var isDataListElement = | 10 var isDataListElement = |
14 predicate((x) => x is DataListElement, 'is a DataListElement'); | 11 predicate((x) => x is DataListElement, 'is a DataListElement'); |
15 | 12 |
16 var div; | 13 var div; |
17 | 14 |
18 setUp(() { | 15 setUp(() { |
19 div = new DivElement(); | 16 div = new DivElement(); |
20 document.body.append(div); | 17 document.body.append(div); |
21 div.innerHtml = """ | 18 div.innerHtml = """ |
22 <input id="input" list="browsers" /> | 19 <input id="input" list="browsers" /> |
(...skipping 16 matching lines...) Expand all Loading... |
39 | 36 |
40 test('is', () { | 37 test('is', () { |
41 expect(() { | 38 expect(() { |
42 var list = document.query('#browsers'); | 39 var list = document.query('#browsers'); |
43 expect(list, isDataListElement); | 40 expect(list, isDataListElement); |
44 }, expectation); | 41 }, expectation); |
45 }); | 42 }); |
46 | 43 |
47 test('list', () { | 44 test('list', () { |
48 expect(() { | 45 expect(() { |
49 var list = document.query('#browsers'); | 46 var list = document.query('#browsers') as DataListElement; |
50 var input = document.query('#input'); | 47 var input = document.query('#input') as InputElement; |
51 expect(input.list, list); | 48 expect(input.list, list); |
52 }, expectation); | 49 }, expectation); |
53 }); | 50 }); |
54 | 51 |
55 test('options', () { | 52 test('options', () { |
56 expect(() { | 53 expect(() { |
57 var options = document.query('#browsers').options; | 54 var options = (document.query('#browsers') as DataListElement).options; |
58 expect(options.length, 5); | 55 expect(options.length, 5); |
59 }, expectation); | 56 }, expectation); |
60 }); | 57 }); |
61 | 58 |
62 test('create', () { | 59 test('create', () { |
63 expect(() { | 60 expect(() { |
64 var list = new DataListElement(); | 61 var list = new DataListElement(); |
65 expect(list, isDataListElement); | 62 expect(list, isDataListElement); |
66 }, expectation); | 63 }, expectation); |
67 }); | 64 }); |
68 } | 65 } |
OLD | NEW |