Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@doodle/ab-connector / src / state / reducer / abReducer.spec.js
Size: Mime:
import { createReducer } from './abReducer';
import { ActionTypes } from '../actions/abActions';
import { initialState } from '../index';

describe('Ab Reducer', () => {
  test('should return the initial state', () => {
    expect(createReducer().ab(undefined, {})).toEqual(initialState);
  });
  test('CHOOSE_EXPERIMENT', () => {
    const name = 'experimentFirst';
    const variant = 'variantA';
    const finalState = {
      ...initialState,
      experiments: {
        [name]: { variant },
      },
    };
    const payload = {
      name,
      variant,
    };
    expect(createReducer().ab(undefined, { type: ActionTypes.CHOOSE_EXPERIMENT, payload })).toEqual(finalState);
  });
});