UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

19 lines 659 B
import _isEqual from "lodash/isEqual"; import assert from 'assert'; import { onSelect } from './SingleSelect.reducers'; describe('SingleSelect reducers', function () { describe('onSelect', function () { it('should set selectedIndex=[newIndex] and update DropMenu state', function () { var initialState = {}; var newIndex = 3; var nextState = onSelect(initialState, newIndex); var selectedIndex = nextState.selectedIndex, DropMenu = nextState.DropMenu; assert(_isEqual(DropMenu, { isExpanded: false, selectedIndices: [3] })); assert(_isEqual(selectedIndex, newIndex)); }); }); });