@@ -9,31 +9,31 @@ configure({ adapter: new Adapter() });
9
9
describe ( 'unit testing for Dropdown.jsx' , ( ) => {
10
10
let wrapper ;
11
11
const props = {
12
- options : [
13
- { value : 2000 , label : '0.5x' } ,
14
- { value : 1000 , label : '1.0x' } ,
15
- { value : 500 , label : '2.0x' } ,
12
+ speeds : [
13
+ { value : 1234 , label : '0.5x' } ,
14
+ { value : 312 , label : '1.0x' } ,
15
+ { value : 23 , label : '2.0x' } ,
16
16
] ,
17
- handleChangeSpeed : jest . fn ( ) ,
18
- selectedOption : { value : 1000 , label : '1.0x' } ,
17
+ setSpeed : jest . fn ( ) ,
18
+ selectedOption : { value : 312 , label : '1.0x' } ,
19
19
} ;
20
20
beforeEach ( ( ) => {
21
21
wrapper = shallow ( < Dropdown { ...props } /> ) ;
22
22
} ) ;
23
23
24
24
describe ( 'Component' , ( ) => {
25
25
test ( 'array of objects that have value and label should be options props' , ( ) => {
26
- expect ( wrapper . props ( ) . options ) . toEqual ( props . options ) ;
26
+ expect ( wrapper . props ( ) . options ) . toEqual ( props . speeds ) ;
27
27
} ) ;
28
28
test ( 'selectedOption should be value property' , ( ) => {
29
- expect ( wrapper . props ( ) . value ) . toEqual ( props . selectedOption ) ;
29
+ expect ( wrapper . props ( ) . value ) . toEqual ( props . selectedSpeed ) ;
30
30
} ) ;
31
31
} ) ;
32
32
33
33
describe ( 'handlechangeSpeed' , ( ) => {
34
34
test ( 'should invoke handleChangeSpeed onChange' , ( ) => {
35
35
wrapper . simulate ( 'change' , { value : 2000 , label : '0.5x' } ) ;
36
- expect ( props . handleChangeSpeed ) . toHaveBeenCalled ( ) ;
36
+ expect ( props . setSpeed ) . toHaveBeenCalled ( ) ;
37
37
} ) ;
38
38
} ) ;
39
39
} ) ;
0 commit comments