feat: allow 3 profile pics (#14092)

* feat: allow 3 profile pics

* test: fix notification test

* test: fix user picture test

* test: relative_path fixes

* fix: relative_path getting saved in when updating profile pic
This commit is contained in:
Barış Uşaklı
2026-03-13 18:42:50 -04:00
committed by GitHub
parent d1e1a0082d
commit 533ae69c46
10 changed files with 194 additions and 138 deletions

View File

@@ -75,7 +75,8 @@ describe('Notifications', () => {
const notifData = await notifications.get(nid);
assert.strictEqual(notifData.icon, undefined);
assert.strictEqual(notifData.user['icon:text'], 'I');
assert.strictEqual(notifData.user['icon:bgColor'], '#3f51b5');
assert(notifData.user['icon:bgColor'].length === 7 &&
notifData.user['icon:bgColor'].startsWith('#'));
});
it('should return null if pid is same and importance is lower', (done) => {

View File

@@ -1028,7 +1028,8 @@ describe('User', () => {
it('should set user picture to uploaded', async () => {
await User.setUserField(uid, 'uploadedpicture', '/test');
await apiUser.changePicture({ uid: uid }, { type: 'uploaded', uid: uid });
await db.sortedSetAdd(`uid:${uid}:profile:pictures`, Date.now(), '/test');
await apiUser.changePicture({ uid: uid }, { type: 'uploaded', picture: '/test', uid: uid });
const picture = await User.getUserField(uid, 'picture');
assert.equal(picture, `${nconf.get('relative_path')}/test`);
});