'use strict';
import { runSaga } from 'redux-saga';
-import { takeLatest } from 'redux-saga/effects';
+import { takeLatest, throttle } from 'redux-saga/effects';
-import { NAME, DESC, LIMIT } from 'features/catalog/catalogConstants';
+import {
+ NAME,
+ DESC,
+ LIMIT,
+ SEARCH_CHANGED,
+ SEARCH_BUFFER
+} from 'features/catalog/catalogConstants';
import catalogApi from '../catalogApi';
import { fetchWorkflow, updateWorkflow } from 'features/catalog/catalogActions';
import catalogSaga, { fetchWorkflowSaga } from 'features/catalog/catalogSagas';
takeLatest(fetchWorkflow, fetchWorkflowSaga)
);
+ expect(gen.next().value).toEqual(
+ throttle(SEARCH_BUFFER, SEARCH_CHANGED, fetchWorkflowSaga)
+ );
expect(gen.next().done).toBe(true);
});
[NAME]: DESC
};
const offset = 0;
+ const searchNameFilter = undefined;
const data = {
paging: {
offset,
hasMore: false,
total: 2
},
+ searchNameFilter: 'w',
items: [
{
id: 'c5b7ca1a0f7944bfa948b85b32c5f314',
expect(catalogApi.getWorkflows).toBeCalledWith(
sort,
LIMIT,
- offset + LIMIT
+ offset + LIMIT,
+ searchNameFilter
);
});
});