示例#1
0
文件: files.js 项目: jonaswindey/io
 it('should throw error when removing file and url is invalid', async () => {
   nock(API).delete('/in/test/-1').reply(500)
   await store.dispatch(fileActions.remove(-1))
   expect(store.getActions()).toEqual([
     {type: constants.REMOVE_FILE_START},
     {type: constants.REMOVE_FILE_FAILED},
   ])
 })
示例#2
0
文件: files.js 项目: jonaswindey/io
  it('should remove file and fetch files', async () => {

    nock(API).get(filesURI()).reply(200, { items: [{_id: -1}] })
    nock(API).delete(`/in/${initialStore.files.project}/-1`).reply(200, { items: [{_id: -1}] })
    await store.dispatch(fileActions.remove(-1))
    expect(store.getActions()).toEqual([
      {type: constants.REMOVE_FILE_START},
      {type: constants.REMOVE_FILE_COMPLETE},
      {type: constants.FETCH_FILES_START},
    ])
  })