command.spec.ts 576 B

123456789101112131415161718
  1. import { loggedOut } from '../../../../actions';
  2. import { CmusUIActionType, commandSet } from '../actions';
  3. import { stateCommandMode } from './fixtures';
  4. import { cmusUIReducer } from './reducer';
  5. describe(CmusUIActionType.CommandSet, () => {
  6. describe('q', () => {
  7. const action = commandSet('q');
  8. it('should set a log out global action', () => {
  9. expect.assertions(2);
  10. const result = cmusUIReducer(stateCommandMode, action);
  11. expect(result.commandMode).toBe(false);
  12. expect(result.globalAction).toStrictEqual(loggedOut());
  13. });
  14. });
  15. });