Skip to content

Commit

Permalink
chore(image-tests): add more more assertions for changing other user
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonVreling committed Dec 7, 2024
1 parent 51b0f18 commit 40ea8a1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/api/users-image-upload.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,13 @@ describe('Users image upload', () => {
});

expect(res.statusCode).toEqual(200);
expect(res.body.success).toEqual(true);
expect(res.body).toHaveProperty('message');

const userFromDb = await User.findByPk(user.id);

const imgPath = path.join(__dirname, '..', '..', config.media_dir, 'headimages', userFromDb.image);
expect(fs.existsSync(imgPath)).toEqual(true);

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

Expand Down

0 comments on commit 40ea8a1

Please sign in to comment.