Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

120
Views
ExpectSaga failes with multiple put effects

Test file: ` const growerId = state.environmentData.environment.selectedGrower.value

const expectedCreateLocalImagesAction = {
  type: 'IMPLEMENT_BLOB_CREATE_LOCAL_IMAGES',
  payload: {
    entities: [
      {
        id: temporaryNewPicId,
        uri:
          'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/',
        attribute: {
          id: 20127625,
          implement: 31276,
          key: 'front_axle_to_gps_inches',
          lastFetchAt: 1591373772572,
          value: '0.39',
          blobs: [10101, 20202],
        },
      },
    ],
    assetId: growerId,
  },
}

const expectedSaveImplementAttributeAction = {
  type: 'IMPLEMENT_ATTRIBUTE_SAVE_IMPLEMENT_ATTRIBUTE',
  payload: {
    id: 20127625,
    implement: 31276,
    key: 'front_axle_to_gps_inches',
    lastFetchAt: 1591373772572,
    value: '0.39',
    blobs: [10101],
  },
}

const expectedUpdateBlobAction = {
  type: 'IMPLEMENT_BLOB_UPDATE_REQUEST',
  payload: {
    requestId: 'updateBlob_1',
    noSync: false,
  },
}

return expectSaga(module.handleSubmitUpdateForm.bind(module), request)
  .withState(state)
  .select(getSelectedGrowerId)
  .put(expectedCreateLocalImagesAction)
  .put(expectedSaveImplementAttributeAction)
  .put(expectedUpdateBlobAction)
  .run()

})`

Got Error ` Expected -------- { '@@redux-saga/IO': true, combinator: false, type: 'PUT', payload: { channel: undefined, action: { type: 'IMPLEMENT_BLOB_CREATE_LOCAL_IMAGES', payload: { entities: [Object], assetId: 680001 } } } }

Actual:
------
1. { '@@redux-saga/IO': true,
  combinator: false,
  type: 'PUT',
  payload:
   { channel: undefined,
     action:
      { type: 'IMPLEMENT_BLOB_CREATE_LOCAL_IMAGES',
        payload: { entities: [Object], assetId: 680001 } } } }
2. { '@@redux-saga/IO': true,
  combinator: false,
  type: 'PUT',
  payload:
   { channel: undefined,
     action:
      { type: 'IMPLEMENT_ATTRIBUTE_SAVE_IMPLEMENT_ATTRIBUTE',
        payload:
         { id: 20127625,
           implement: 31276,
           key: 'front_axle_to_gps_inches',
           lastFetchAt: 1591373772572,
           value: '0.39',
           blobs: [Object] } } } }
3. { '@@redux-saga/IO': true,
  combinator: false,
  type: 'PUT',
  payload:
   { channel: undefined,
     action:
      { type: 'IMPLEMENT_BLOB_UPDATE_REQUEST',
        payload: { requestId: 'updateBlob_1', entities: [Object], noSync: false } } } }`

I have put three actions in my jest test file, so the expectation should have been three too. But actually, I got only one? What's wrong with it?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!