break-last-call.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. export default store => {
  2. return callApi(endpoint, schema).then(
  3. response => next(actionWith({
  4. response,
  5. type: successType
  6. })),
  7. error => next(actionWith({
  8. type: failureType,
  9. error: error.message || 'Something bad happened'
  10. }))
  11. )
  12. }
  13. it('should group messages with same created time', () => {
  14. expect(
  15. groupMessages(messages).toJS(),
  16. ).toEqual({
  17. '11/01/2017 13:36': [
  18. {message: 'test', messageType: 'SMS', status: 'Unknown', created: '11/01/2017 13:36'},
  19. {message: 'test', messageType: 'Email', status: 'Unknown', created: '11/01/2017 13:36'},
  20. ],
  21. '09/01/2017 17:25': [
  22. {message: 'te', messageType: 'SMS', status: 'Unknown', created: '09/01/2017 17:25'},
  23. {message: 'te', messageType: 'Email', status: 'Unknown', created: '09/01/2017 17:25'},
  24. ],
  25. '11/01/2017 13:33': [
  26. {message: 'test', messageType: 'SMS', status: 'Unknown', created: '11/01/2017 13:33'},
  27. {message: 'test', messageType: 'Email', status: 'Unknown', created: '11/01/2017 13:33'},
  28. ],
  29. '11/01/2017 13:37': [
  30. {message: 'test', messageType: 'SMS', status: 'Unknown', created: '11/01/2017 13:37'},
  31. {message: 'test', messageType: 'Email', status: 'Unknown', created: '11/01/2017 13:37'},
  32. ],
  33. });
  34. });