test('dispatches fetchUsersByNameSuccess on success', function () {
  const fetchSpy = this.spy(SearchFormActions, 'fetchUsersByNameSuccess');
  const promise = this.dispatchSpy(SearchFormActions.getNameOptions('graders', 'Norval'));
  return promise.then(() => {
    strictEqual(fetchSpy.callCount, 1);
  });
});
test('dispatches fetchUsersByNameFailure on failure', function () {
  this.getUsersByNameStub.returns(Promise.reject(new Error('FAIL')));
  const fetchSpy = this.spy(SearchFormActions, 'fetchUsersByNameFailure');
  const promise = this.dispatchSpy(SearchFormActions.getNameOptions('graders', 'Norval'));
  return promise.then(() => {
    strictEqual(fetchSpy.callCount, 1);
  });
});
示例#3
0
 getNameOptions: (userType, searchTerm) => {
   dispatch(SearchFormActions.getNameOptions(userType, searchTerm));
 },