|
@@ -1,5 +1,6 @@
|
|
|
import {
|
|
import {
|
|
|
activeClientToggled,
|
|
activeClientToggled,
|
|
|
|
|
+ LocalAction,
|
|
|
masterSet,
|
|
masterSet,
|
|
|
playPaused,
|
|
playPaused,
|
|
|
queuePushed,
|
|
queuePushed,
|
|
@@ -7,6 +8,7 @@ import {
|
|
|
stateSet,
|
|
stateSet,
|
|
|
} from '../../../../actions';
|
|
} from '../../../../actions';
|
|
|
import { ActionKeyPressed, ActionTypeKeyPressed, Keys } from '../../../../hooks/vim';
|
|
import { ActionKeyPressed, ActionTypeKeyPressed, Keys } from '../../../../hooks/vim';
|
|
|
|
|
+import { globalReducer, initialState } from '../../../../reducer';
|
|
|
|
|
|
|
|
import { CmusUIState, LibraryModeWindow, Overlay, View } from '../types';
|
|
import { CmusUIState, LibraryModeWindow, Overlay, View } from '../types';
|
|
|
|
|
|
|
@@ -116,6 +118,20 @@ describe(ActionTypeKeyPressed, () => {
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ describe(Keys.S, () => {
|
|
|
|
|
+ const action: ActionKeyPressed = { type: ActionTypeKeyPressed, key: Keys.S };
|
|
|
|
|
+
|
|
|
|
|
+ it('should toggle the shuffle value', () => {
|
|
|
|
|
+ expect.assertions(2);
|
|
|
|
|
+ const result = cmusUIReducer(initialCmusUIState, action);
|
|
|
|
|
+ const { globalAction } = result;
|
|
|
|
|
+ const globalResult = globalReducer(initialState, globalAction as LocalAction);
|
|
|
|
|
+ expect(globalResult.player.shuffleMode).toBe(true);
|
|
|
|
|
+ const nextGlobalResult = globalReducer(globalResult, globalAction as LocalAction);
|
|
|
|
|
+ expect(nextGlobalResult.player.shuffleMode).toBe(false);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
describe(Keys.space, () => {
|
|
describe(Keys.space, () => {
|
|
|
const action: ActionKeyPressed = { type: ActionTypeKeyPressed, key: Keys.space };
|
|
const action: ActionKeyPressed = { type: ActionTypeKeyPressed, key: Keys.space };
|
|
|
|
|
|