message: added storage tests
diff: @@ -21,6 +21,11 @@ it('should upload a new file', async () => {
  fileToken = token
  })
  +it('should fail if trying to upload, without a file attached', async () => {
  + const { status } = await request.post(`/storage/o/user/${getUserId()}/${filePath}`)
  + expect(status).toEqual(400)
  +})
  +
  it('should update an existing file', async () => {
  const { status } = await request
  .post(`/storage/o/user/${getUserId()}/${filePath}`)
  @@ -28,6 +33,18 @@ it('should update an existing file', async () => {
  expect(status).toEqual(200)
  })
  +it('should not upload file on missing file name in correct path', async () => {
  + const { status } = await request.post(`/storage/o/user/${getUserId()}/`).attach('file', filePath)
  + expect(status).toEqual(404)
  +})
  +
  +it('should not upload file on incorrect file path', async () => {
  + const { status } = await request
  + .post(`/storage/o/user/${getUserId()}/123/`)
  + .attach('file', filePath)
  + expect(status).toEqual(500)
  +})
  +
  it('should not update an hypothetical file of another hypothetical user', async () => {
  const { status } = await request
  .post(`/storage/o/user/another-user/another-file`)
  @@ -60,6 +77,13 @@ describe('Tests as an unauthenticated user', () => {
  expect(text).toEqual(fileData)
  })
  + it('should not get file from incorrect token while unauthenticated', async () => {
  + const { status } = await request
  + .get(`/storage/o/user/${getUserId()}/${filePath}`)
  + .query({ token: 'incorrect' })
  + expect(status).toEqual(403)
  + })
  +
  it('should not get file without authentication nor token', async () => {
  const { status } = await request.get(`/storage/o/user/${getUserId()}/${filePath}`)
  expect(status).toEqual(403)
  @@ -115,6 +139,17 @@ it('should get a zip that contains all user files', async () => {
  // })
  it('should delete file', async () => {
  - const { status } = await request.delete(`/storage/m/user/${getUserId()}/${filePath}`)
  + const { status } = await request.delete(`/storage/o/user/${getUserId()}/${filePath}`)
  expect(status).toEqual(204)
  })
  +
  +it('should not be able to get deleted file', async () => {
  + const { status } = await request.get(`/storage/o/user/${getUserId()}/${filePath}`)
  + expect(status).toEqual(404)
  +})
  +
  +it('should get the headers of no files', async () => {
  + const { status, body } = await request.get(`/storage/m/user/${getUserId()}/`)
  + expect(status).toEqual(200)
  + expect(body).toBeArrayOfSize(0)
  +})
  