OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 @TestOn('browser') | 4 @TestOn('browser') |
5 library polymer_elements.test.paper_button_test; | 5 library polymer_elements.test.paper_button_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'package:polymer_elements/paper_button.dart'; | 8 import 'package:polymer_elements/paper_button.dart'; |
9 import 'package:web_components/web_components.dart'; | 9 import 'package:web_components/web_components.dart'; |
10 import 'package:test/test.dart'; | 10 import 'package:test/test.dart'; |
11 import 'common.dart'; | 11 import 'common.dart'; |
12 | 12 |
13 main() async { | 13 main() async { |
14 await initWebComponents(); | 14 await initWebComponents(); |
15 | 15 |
16 group('<paper-button>', () { | 16 group('<paper-button>', () { |
17 PaperButton button; | 17 PaperButton button; |
18 setUp(() { | 18 setUp(() { |
19 button = fixture('TrivialButton'); | 19 button = fixture('TrivialButton'); |
20 }); | 20 }); |
21 | 21 |
22 test('can be raised imperatively', () { | 22 test('can be raised imperatively', () { |
23 Completer done = new Completer(); | 23 Completer done = new Completer(); |
24 button.raised = true; | 24 button.raised = true; |
25 expect(button.getAttribute('raised'), isNotNull); | 25 expect(button.getAttribute('raised'), isNotNull); |
26 wait(1).then((_) { | 26 wait(1).then((_) { |
27 try { | 27 try { |
28 expect(button.jsElement['_elevation'], equals(1)); | 28 expect(button.elevation, equals(1)); |
29 done.complete(); | 29 done.complete(); |
30 } catch (e) { | 30 } catch (e) { |
31 done.complete(e); | 31 done.complete(e); |
32 } | 32 } |
33 }); | 33 }); |
34 }); | 34 }); |
35 | 35 |
36 test('can be disabled imperatively', () { | 36 test('can be disabled imperatively', () { |
37 button.disabled = true; | 37 button.disabled = true; |
38 expect(button.getAttribute('aria-disabled'), equals('true')); | 38 expect(button.getAttribute('aria-disabled'), equals('true')); |
(...skipping 29 matching lines...) Expand all Loading... |
68 }); | 68 }); |
69 | 69 |
70 test('has aria role "button"', () { | 70 test('has aria role "button"', () { |
71 expect(button.getAttribute('role'), 'button'); | 71 expect(button.getAttribute('role'), 'button'); |
72 }); | 72 }); |
73 | 73 |
74 // TODO(jakemac): What is this? | 74 // TODO(jakemac): What is this? |
75 // a11ySuite('TrivialButton'); | 75 // a11ySuite('TrivialButton'); |
76 }); | 76 }); |
77 } | 77 } |
OLD | NEW |