mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-25 19:13:54 +00:00
Move SET_VOLUME to actionCreators
This commit is contained in:
parent
a38eba5d23
commit
92b19c9ecf
1 changed files with 19 additions and 6 deletions
|
|
@ -3,12 +3,7 @@ jest.unmock('../utils');
|
|||
import {
|
||||
getTimeObj,
|
||||
getTimeStr,
|
||||
getBalanceText,
|
||||
getVolumeText,
|
||||
getPositionText,
|
||||
getMediaText,
|
||||
getDoubleSizeModeText,
|
||||
wrapForMarquee
|
||||
clamp
|
||||
} from '../utils';
|
||||
|
||||
describe('getTimeObj', () => {
|
||||
|
|
@ -41,3 +36,21 @@ describe('getTimeStr', () => {
|
|||
expect(actual).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describe('clamp', () => {
|
||||
it('respects the max value', () => {
|
||||
const actual = clamp(101, 0, 100);
|
||||
const expected = 100;
|
||||
expect(actual).toEqual(expected);
|
||||
});
|
||||
it('respects the min value', () => {
|
||||
const actual = clamp(0, 1, 100);
|
||||
const expected = 1;
|
||||
expect(actual).toEqual(expected);
|
||||
});
|
||||
it('respects the given value if in range', () => {
|
||||
const actual = clamp(50, 0, 100);
|
||||
const expected = 50;
|
||||
expect(actual).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue