Skip to content

Commit 40ea8a1

Browse files
committed
chore(image-tests): add more more assertions for changing other user
1 parent 51b0f18 commit 40ea8a1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/api/users-image-upload.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,13 @@ describe('Users image upload', () => {
208208
});
209209

210210
expect(res.statusCode).toEqual(200);
211+
expect(res.body.success).toEqual(true);
212+
expect(res.body).toHaveProperty('message');
213+
214+
const userFromDb = await User.findByPk(user.id);
215+
216+
const imgPath = path.join(__dirname, '..', '..', config.media_dir, 'headimages', userFromDb.image);
217+
expect(fs.existsSync(imgPath)).toEqual(true);
211218

212219
const adminFromDb = await User.findByPk(admin.id);
213220

0 commit comments

Comments
 (0)