Skip to content

Commit 899c229

Browse files
committed
Adding in checks for default values in the volume component
1 parent b0c0d84 commit 899c229

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/components/Volume.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,25 @@ import sinon from 'sinon';
88
import Volume from '../../app/components/Volume.jsx';
99

1010
describe('<Volume />', () => {
11+
it('renders the volume control with the default values', () => {
12+
const value = 5;
13+
const wrapper = shallow(
14+
<Volume value={value} onChange={() => {}} />
15+
);
16+
const input = wrapper.find('input');
17+
18+
assert.equal(input.prop('min'), 0);
19+
assert.equal(input.prop('max'), 100);
20+
assert.equal(input.prop('step'), 5);
21+
});
22+
1123
it('renders the volume control with the correct value', () => {
1224
const value = 5;
1325
const wrapper = shallow(
1426
<Volume value={value} onChange={() => {}} />
1527
);
1628

17-
assert.equal(wrapper.props().value, 5);
29+
assert.equal(wrapper.find('input').prop('value'), 5);
1830
});
1931

2032
it('calls the onChange function', () => {

0 commit comments

Comments
 (0)