From 67c572f187370d51a86e2b82d27abafa8b9b0db7 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 15 Mar 2024 10:48:24 +0100 Subject: [PATCH] fixed dropped test --- back/methods/image/specs/download.spec.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/back/methods/image/specs/download.spec.js b/back/methods/image/specs/download.spec.js index 1feadf517..e7357d5a4 100644 --- a/back/methods/image/specs/download.spec.js +++ b/back/methods/image/specs/download.spec.js @@ -4,13 +4,22 @@ describe('image download()', () => { const collection = 'user'; const size = '160x160'; const employeeId = 1; + const developerId = 9; + const jessicaJonesId = 1110; const ctx = {req: {accessToken: {userId: employeeId}}}; it('should return the image content-type of the user', async() => { - const userId = 9; - const image = await models.Image.download(ctx, collection, size, userId); + const image = await models.Image.download(ctx, collection, size, developerId); const contentType = image[1]; expect(contentType).toEqual('image/png'); }); + + // TEST RETURNS TRUE IF USER IMAGE ID MATCHES WITH THE DOWNLOAD IMAGE NAME + it('should return the user profile picture', async() => { + const image = await models.Image.download(ctx, collection, size, jessicaJonesId); + const fileName = image[2]; + + expect(fileName).toMatch('1110.png'); + }); });