diff --git a/back/methods/image/specs/upload.spec.js b/back/methods/image/specs/upload.spec.js index 8521f2f20..86b598b49 100644 --- a/back/methods/image/specs/upload.spec.js +++ b/back/methods/image/specs/upload.spec.js @@ -1,11 +1,6 @@ const app = require('vn-loopback/server/server'); describe('image upload()', () => { - afterEach(() => { - // RESTORE NODE ENV - delete process.env.NODE_ENV; - }); - describe('as buyer', () => { const buyerId = 35; const workerId = 106; @@ -46,26 +41,6 @@ describe('image upload()', () => { expect(containerModel.upload).toHaveBeenCalled(); }); - - it('should throw an error to upload a photo on test environment', async() => { - process.env.NODE_ENV = 'test'; - - const ctx = {req: {accessToken: {userId: buyerId}}, - args: { - id: itemId, - collection: 'catalog' - } - }; - - let error; - try { - await app.models.Image.upload(ctx); - } catch (err) { - error = err; - } - - expect(error.message).toEqual(`You can't upload images on the test instance`); - }); }); describe('as marketing', () => { diff --git a/back/methods/image/upload.js b/back/methods/image/upload.js index 59e9738ec..649d13c68 100644 --- a/back/methods/image/upload.js +++ b/back/methods/image/upload.js @@ -50,8 +50,6 @@ module.exports = Self => { if (process.env.NODE_ENV == 'test') throw new UserError(`You can't upload images on the test instance`); - await TempContainer.allowedContentTypes(); - // Upload file to temporary path const tempContainer = await TempContainer.container(args.collection); const uploaded = await TempContainer.upload(tempContainer.name, ctx.req, ctx.result, fileOptions);