@@ -6,7 +6,7 @@ import { renderWithTheme } from '../../test/utils';
6
6
import { Select } from './Select' ;
7
7
import { SelectOption , SelectRef } from './Select.types' ;
8
8
9
- const options : SelectOption [ ] = [
9
+ const options : SelectOption < number > [ ] = [
10
10
{ label : 'ten' , value : 10 } ,
11
11
{ label : 'twenty' , value : 20 } ,
12
12
{ label : 'thirty' , value : 30 }
@@ -65,7 +65,7 @@ describe('<Select />', () => {
65
65
}
66
66
} }
67
67
options = { [
68
- { label : 'ten' , value : 10 } ,
68
+ { label : 'ten' , value : '10' } ,
69
69
{ label : 'none' , value : '' }
70
70
] }
71
71
/>
@@ -153,7 +153,7 @@ describe('<Select />', () => {
153
153
it ( 'should get selected option from arguments' , ( ) => {
154
154
const onChange = jest . fn ( ) ;
155
155
const { getAllByRole, getByRole } = renderWithTheme (
156
- < Select onChange = { onChange } value = '0' options = { options } />
156
+ < Select onChange = { onChange } value = { 0 } options = { options } />
157
157
) ;
158
158
fireEvent . mouseDown ( getByRole ( 'button' ) ) ;
159
159
getAllByRole ( 'option' ) [ 1 ] . click ( ) ;
@@ -331,7 +331,7 @@ describe('<Select />', () => {
331
331
describe ( 'prop: readOnly' , ( ) => {
332
332
it ( 'should not trigger any event with readOnly' , ( ) => {
333
333
const { getByRole, queryByRole } = renderWithTheme (
334
- < Select readOnly value = '10' options = { options } />
334
+ < Select readOnly value = { 10 } options = { options } />
335
335
) ;
336
336
getByRole ( 'button' ) . focus ( ) ;
337
337
const focusedButton = document . activeElement as HTMLElement ;
@@ -347,7 +347,7 @@ describe('<Select />', () => {
347
347
const { getByRole } = renderWithTheme (
348
348
< Select
349
349
SelectDisplayProps = { { 'data-test' : 'SelectDisplay' } }
350
- value = '10'
350
+ value = { 10 }
351
351
options = { options }
352
352
/>
353
353
) ;
@@ -357,7 +357,7 @@ describe('<Select />', () => {
357
357
358
358
describe ( 'prop: renderValue' , ( ) => {
359
359
it ( 'should use the prop to render the value' , ( ) => {
360
- const formatDisplay = ( x : SelectOption ) =>
360
+ const formatDisplay = ( x : SelectOption < number > ) =>
361
361
`0b${ Number ( x . value ) . toString ( 2 ) } ` ;
362
362
const { getByRole } = renderWithTheme (
363
363
< Select
0 commit comments