mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 20:17:32 +02:00
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:
@@ -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) => {
|
||||
|
||||
@@ -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`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user