UNPKG

redux-form

Version:

A higher order component decorator for forms using Redux and React

14 lines (12 loc) 455 B
import expect, { createSpy } from 'expect'; import createOnFocus from '../createOnFocus'; describe('createOnFocus', function () { it('should return a function', function () { expect(createOnFocus()).toExist().toBeA('function'); }); it('should return a function that calls focus with name', function () { var focus = createSpy(); createOnFocus('foo', focus)(); expect(focus).toHaveBeenCalled().toHaveBeenCalledWith('foo'); }); });