UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

25 lines 821 B
import { onSwipe, onPrev, onNext } from './DateSelect.reducers'; describe('DateSelect reducers', function () { var initialState = { offset: 0 }; describe('onSwipe', function () { it('should update the offset with the relative number of slides swiped', function () { var slidesSwiped = -3; var nextState = onSwipe(initialState, slidesSwiped); expect(nextState.offset).toBe(-3); }); }); describe('onPrev', function () { it('should decrease the offset by one slide', function () { var nextState = onPrev(initialState); expect(nextState.offset).toBe(-1); }); }); describe('onNext', function () { it('should increase the offset by one slide', function () { var nextState = onNext(initialState); expect(nextState.offset).toBe(1); }); }); });