@@ -132,6 +132,41 @@ describe('getRole', function () {
132132 expect ( getRole ( { } , node ) ) . to . equal ( 'group' )
133133 } )
134134
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+
135170 // <link> does not map to anything.
136171 it ( 'returns undefined role for <link>' , function ( ) {
137172 const node = mockJSXOpeningElement ( 'link' )
0 commit comments