Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. export function* mySaga(spaceId) {
  2. while (true) {
  3. const action = yield take(
  4. action =>
  5. action.type === MEDIA_SESSION_RESPONSE &&
  6. action.payload.data.category === ScreenShareData &&
  7. action.payload.data.topicId === spaceId
  8. );
  9. const remoteScreenSessionId = action.payload.data.content.sessionId;
  10. yield put(addRemoteScreenSessionId(remoteScreenSessionId));
  11. }
  12. }
  13.  
  14. it('test', () => {
  15. const gen = sagas.mySaga('space_1');
  16. expect(gen.next().value).toEqual(
  17. take(
  18. action =>
  19. action.type === MEDIA_SESSION_RESPONSE &&
  20. action.payload.data.category === ScreenShareData &&
  21. action.payload.data.topicId === spaceId
  22. )
  23. );
  24. });
  25.  
  26. Expected value to equal:
  27. {"@@redux-saga/IO": true, "combinator": false, "payload": {"pattern": [Function anonymous]}, "type": "TAKE"}
  28. Received:
  29. {"@@redux-saga/IO": true, "combinator": false, "payload": {"pattern": [Function anonymous]}, "type": "TAKE"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement