Skip to content

Commit f45b403

Browse files
committed
Updating volume values, installed lodash
1 parent 7e9fce5 commit f45b403

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

app/components/Volume.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class Volume extends Component {
1616

1717
Volume.defaultProps = {
1818
min: 0,
19-
max: 11,
20-
step: 1
19+
max: 100,
20+
step: 5
2121
};
2222

2323
Volume.propTypes = {

app/containers/PlaybackControls.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22

3+
import _ from 'lodash';
34
import React, { Component } from 'react';
45

56
import { bindActionCreators } from 'redux';
@@ -22,7 +23,7 @@ export class PlaybackControls extends Component {
2223
}
2324

2425
_onVolumeChange(event) {
25-
const volumeValue = event.target.value;
26+
const volumeValue = _.get(event, 'target.value');
2627
this.props.setVolumeAction(volumeValue);
2728
}
2829

app/reducers/playback.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { SET_VOLUME } from '../actions/setVolume';
77
const initialState = {
88
isPlaying: false,
99
hasStopped: true,
10-
volume: 7
10+
volume: 50
1111
};
1212

1313
function setIsPlayingState(isPlaying) {

test/containers/PlaybackControls.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('<PlaybackControls />', () => {
5151
});
5252
});
5353

54-
describe.only('<Volume />', () => {
54+
describe('<Volume />', () => {
5555
it('calls the setVolumeAction', () => {
5656
const setVolumeActionSpy = sinon.spy();
5757
const wrapper = shallow(<PlaybackControls setVolumeAction={setVolumeActionSpy} />);

test/reducers/playback.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@ describe('playbackState', () => {
5858
});
5959

6060
describe('volume property', () => {
61-
it('defaults to 7', () => {
62-
assert.strictEqual(playbackReducer(undefined, '').volume, 7);
61+
it('defaults to 50', () => {
62+
assert.strictEqual(playbackReducer(undefined, '').volume, 50);
6363
});
6464

65-
it('{volume: 1} when action.volume is 1', () => {
65+
it('{volume: 75} when action.volume is 75', () => {
6666
const state = playbackReducer(undefined, {
6767
type: SET_VOLUME,
68-
volume: 1
68+
volume: 75
6969
});
7070

71-
assert.strictEqual(state.volume, 1);
71+
assert.strictEqual(state.volume, 75);
7272
});
7373
});
7474
});

0 commit comments

Comments
 (0)