OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 custom_tags_test; | |
6 import 'package:unittest/unittest.dart'; | |
7 import 'package:unittest/html_config.dart'; | |
8 import 'dart:html'; | 5 import 'dart:html'; |
| 6 |
| 7 import 'package:minitest/minitest.dart'; |
| 8 |
9 import 'utils.dart'; | 9 import 'utils.dart'; |
10 | 10 |
11 main() { | 11 main() { |
12 useHtmlConfiguration(); | |
13 | |
14 test('create via custom tag', () { | 12 test('create via custom tag', () { |
15 var element = new Element.tag('x-basic1')..id = 'basic1'; | 13 var element = new Element.tag('x-basic1')..id = 'basic1'; |
16 document.body.nodes.add(element); | 14 document.body.nodes.add(element); |
17 | 15 |
18 var queryById = query('#basic1'); | 16 var queryById = query('#basic1'); |
19 expect(queryById, equals(element)); | 17 expect(queryById, equals(element)); |
20 | 18 |
21 var queryByTag = queryAll('x-basic1'); | 19 var queryByTag = queryAll('x-basic1'); |
22 expect(queryByTag.length, equals(1)); | 20 expect(queryByTag.length, equals(1)); |
23 expect(queryByTag[0], equals(element)); | 21 expect(queryByTag[0], equals(element)); |
(...skipping 16 matching lines...) Expand all Loading... |
40 test('type extension inner html', () { | 38 test('type extension inner html', () { |
41 var element = new DivElement(); | 39 var element = new DivElement(); |
42 element.setInnerHtml("<div is='x-basic3' id='basic3'></div>", | 40 element.setInnerHtml("<div is='x-basic3' id='basic3'></div>", |
43 treeSanitizer: new NullTreeSanitizer()); | 41 treeSanitizer: new NullTreeSanitizer()); |
44 document.body.nodes.add(element); | 42 document.body.nodes.add(element); |
45 | 43 |
46 var queryById = query('#basic3'); | 44 var queryById = query('#basic3'); |
47 expect(queryById is DivElement, isTrue); | 45 expect(queryById is DivElement, isTrue); |
48 }); | 46 }); |
49 } | 47 } |
OLD | NEW |