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_radio_button_basic_test; | 5 library polymer_elements.test.paper_radio_button_basic_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'package:test/test.dart'; | 8 import 'package:test/test.dart'; |
9 import 'package:web_components/web_components.dart'; | 9 import 'package:web_components/web_components.dart'; |
10 import 'package:polymer_elements/paper_radio_button.dart'; | 10 import 'package:polymer_elements/paper_radio_button.dart'; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 r1 = fixture('NoLabel'); | 63 r1 = fixture('NoLabel'); |
64 r2 = fixture('WithLabel'); | 64 r2 = fixture('WithLabel'); |
65 }); | 65 }); |
66 | 66 |
67 test('has aria role "radio"', () { | 67 test('has aria role "radio"', () { |
68 expect(r1.attributes['role'], equals('radio')); | 68 expect(r1.attributes['role'], equals('radio')); |
69 expect(r2.attributes['role'], equals('radio')); | 69 expect(r2.attributes['role'], equals('radio')); |
70 }); | 70 }); |
71 | 71 |
72 test('button with no label has no aria label', () { | 72 test('button with no label has no aria label', () { |
73 expect(r1.attributes['aria-label'], isEmpty); | 73 expect(r1.attributes['aria-label'], isNull); |
74 }); | |
75 | |
76 test('button with a label sets an aria label', () { | |
77 expect(r2.attributes['aria-label'], equals("Batman")); | |
78 }); | 74 }); |
79 | 75 |
80 test('button respects the user set aria-label', () { | 76 test('button respects the user set aria-label', () { |
81 var c = fixture('AriaLabel'); | 77 var c = fixture('AriaLabel'); |
82 expect(c.attributes['aria-label'], equals("Batman")); | 78 expect(c.attributes['aria-label'], equals("Batman")); |
83 }); | 79 }); |
84 | 80 |
85 // TODO(jakemac): Investigate these. | 81 // TODO(jakemac): Investigate these. |
86 // a11ySuite('NoLabel'); | 82 // a11ySuite('NoLabel'); |
87 // a11ySuite('WithLabel'); | 83 // a11ySuite('WithLabel'); |
88 // a11ySuite('AriaLabel'); | 84 // a11ySuite('AriaLabel'); |
89 }); | 85 }); |
90 } | 86 } |
OLD | NEW |