7152-devToTest_2414 #2228
|
@ -4,13 +4,22 @@ describe('image download()', () => {
|
||||||
const collection = 'user';
|
const collection = 'user';
|
||||||
const size = '160x160';
|
const size = '160x160';
|
||||||
const employeeId = 1;
|
const employeeId = 1;
|
||||||
|
const developerId = 9;
|
||||||
|
const jessicaJonesId = 1110;
|
||||||
const ctx = {req: {accessToken: {userId: employeeId}}};
|
const ctx = {req: {accessToken: {userId: employeeId}}};
|
||||||
|
|
||||||
it('should return the image content-type of the user', async() => {
|
it('should return the image content-type of the user', async() => {
|
||||||
const userId = 9;
|
const image = await models.Image.download(ctx, collection, size, developerId);
|
||||||
const image = await models.Image.download(ctx, collection, size, userId);
|
|
||||||
const contentType = image[1];
|
const contentType = image[1];
|
||||||
|
|
||||||
expect(contentType).toEqual('image/png');
|
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');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue