users: add unset route for avatar

also add missing tests for avatar and profile locking
This commit is contained in:
Girish Ramakrishnan
2025-07-15 10:06:26 +02:00
parent be9adb64bb
commit 622aecfd6d
9 changed files with 122 additions and 3 deletions
+12
View File
@@ -328,6 +328,18 @@ describe('Profile API', function () {
expect(parseInt(response.headers['content-length'])).to.equal(customAvatarSize);
expect(response.status).to.equal(200);
});
it('can unset custom avatar', async function () {
const response = await superagent.del(`${serverUrl}/api/v1/profile/avatar`)
.query({ access_token: user.token });
expect(response.status).to.be(204);
});
it('did unset custom avatar', async function () {
const response = await superagent.get(`${serverUrl}/api/v1/profile/avatar/${user.id}`).ok(() => true);
expect(response.status).to.be(404);
});
});
describe('background', function () {