File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ Volume.defaultProps = {
22
22
23
23
Volume . propTypes = {
24
24
onChange : React . PropTypes . func . isRequired ,
25
- value : React . PropTypes . number ,
25
+ value : React . PropTypes . number . isRequired ,
26
26
min : React . PropTypes . number ,
27
27
max : React . PropTypes . number ,
28
28
step : React . PropTypes . number
Original file line number Diff line number Diff line change @@ -7,11 +7,12 @@ import sinon from 'sinon';
7
7
8
8
import Volume from '../../app/components/Volume.jsx' ;
9
9
10
+ const VALUE = 5 ;
11
+
10
12
describe ( '<Volume />' , ( ) => {
11
13
it ( 'renders the volume control with the default values' , ( ) => {
12
- const value = 5 ;
13
14
const wrapper = shallow (
14
- < Volume value = { value } onChange = { ( ) => { } } />
15
+ < Volume value = { VALUE } onChange = { ( ) => { } } />
15
16
) ;
16
17
const input = wrapper . find ( 'input' ) ;
17
18
@@ -21,9 +22,8 @@ describe('<Volume />', () => {
21
22
} ) ;
22
23
23
24
it ( 'renders the volume control with the correct value' , ( ) => {
24
- const value = 5 ;
25
25
const wrapper = shallow (
26
- < Volume value = { value } onChange = { ( ) => { } } />
26
+ < Volume value = { VALUE } onChange = { ( ) => { } } />
27
27
) ;
28
28
29
29
assert . equal ( wrapper . find ( 'input' ) . prop ( 'value' ) , 5 ) ;
@@ -32,7 +32,7 @@ describe('<Volume />', () => {
32
32
it ( 'calls the onChange function' , ( ) => {
33
33
const onChangeSpy = sinon . spy ( ) ;
34
34
const wrapper = shallow (
35
- < Volume onChange = { onChangeSpy } />
35
+ < Volume value = { VALUE } onChange = { onChangeSpy } />
36
36
) ;
37
37
wrapper . find ( 'input' ) . simulate ( 'change' ) ;
38
38
assert . equal ( onChangeSpy . calledOnce , true ) ;
You can’t perform that action at this time.
0 commit comments