@@ -132,6 +132,41 @@ describe('getRole', function () {
132
132
expect ( getRole ( { } , node ) ) . to . equal ( 'group' )
133
133
} )
134
134
135
+ it ( 'returns group role for <details>' , function ( ) {
136
+ const node = mockJSXOpeningElement ( 'details' )
137
+ expect ( getRole ( { } , node ) ) . to . equal ( 'group' )
138
+ } )
139
+
140
+ // <input>
141
+ it ( 'returns slider role for <input> with type range' , function ( ) {
142
+ const node = mockJSXOpeningElement ( 'input' , [ mockJSXAttribute ( 'type' , 'range' ) ] )
143
+ expect ( getRole ( { } , node ) ) . to . equal ( 'slider' )
144
+ } )
145
+
146
+ it ( 'returns spinbutton for <input> with type number' , function ( ) {
147
+ const node = mockJSXOpeningElement ( 'input' , [ mockJSXAttribute ( 'type' , 'number' ) ] )
148
+ expect ( getRole ( { } , node ) ) . to . equal ( 'spinbutton' )
149
+ } )
150
+
151
+ it ( 'returns checkbox for <input> with type checkbox' , function ( ) {
152
+ const node = mockJSXOpeningElement ( 'input' , [ mockJSXAttribute ( 'type' , 'checkbox' ) ] )
153
+ expect ( getRole ( { } , node ) ) . to . equal ( 'checkbox' )
154
+ } )
155
+
156
+ it ( 'returns button for <input> with type button, image, reset, submit' , function ( ) {
157
+ const button = mockJSXOpeningElement ( 'input' , [ mockJSXAttribute ( 'type' , 'button' ) ] )
158
+ expect ( getRole ( { } , button ) ) . to . equal ( 'button' )
159
+
160
+ const image = mockJSXOpeningElement ( 'input' , [ mockJSXAttribute ( 'type' , 'image' ) ] )
161
+ expect ( getRole ( { } , image ) ) . to . equal ( 'button' )
162
+
163
+ const reset = mockJSXOpeningElement ( 'input' , [ mockJSXAttribute ( 'type' , 'reset' ) ] )
164
+ expect ( getRole ( { } , reset ) ) . to . equal ( 'button' )
165
+
166
+ const submit = mockJSXOpeningElement ( 'input' , [ mockJSXAttribute ( 'type' , 'submit' ) ] )
167
+ expect ( getRole ( { } , submit ) ) . to . equal ( 'button' )
168
+ } )
169
+
135
170
// <link> does not map to anything.
136
171
it ( 'returns undefined role for <link>' , function ( ) {
137
172
const node = mockJSXOpeningElement ( 'link' )
0 commit comments