test: fix tests

This commit is contained in:
Barış Soner Uşaklı
2024-11-25 18:42:59 -05:00
parent 669c9c5027
commit 173c604a2c
2 changed files with 2 additions and 4 deletions

View File

@@ -50,7 +50,7 @@ module.exports = function (User) {
lastonline: timestamp,
status: 'online',
};
['picture', 'fullname', 'location', 'birthday'].forEach((field) => {
['picture', 'fullname', 'birthday'].forEach((field) => {
if (data[field]) {
userData[field] = data[field];
}

View File

@@ -737,8 +737,6 @@ describe('User', () => {
username: 'updatedUserName',
email: 'updatedEmail@me.com',
fullname: 'updatedFullname',
website: 'http://nodebb.org',
location: 'izmir',
groupTitle: 'testGroup',
birthday: '01/01/1980',
signature: 'nodebb is good',
@@ -747,7 +745,7 @@ describe('User', () => {
const result = await apiUser.update({ uid: uid }, { ...data, password: '123456', invalid: 'field' });
assert.equal(result.username, 'updatedUserName');
assert.equal(result.userslug, 'updatedusername');
assert.equal(result.location, 'izmir');
assert.equal(result.fullname, 'updatedFullname');
const userData = await db.getObject(`user:${uid}`);
Object.keys(data).forEach((key) => {