mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
test: fix tests
This commit is contained in:
@@ -50,7 +50,7 @@ module.exports = function (User) {
|
|||||||
lastonline: timestamp,
|
lastonline: timestamp,
|
||||||
status: 'online',
|
status: 'online',
|
||||||
};
|
};
|
||||||
['picture', 'fullname', 'location', 'birthday'].forEach((field) => {
|
['picture', 'fullname', 'birthday'].forEach((field) => {
|
||||||
if (data[field]) {
|
if (data[field]) {
|
||||||
userData[field] = data[field];
|
userData[field] = data[field];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -737,8 +737,6 @@ describe('User', () => {
|
|||||||
username: 'updatedUserName',
|
username: 'updatedUserName',
|
||||||
email: 'updatedEmail@me.com',
|
email: 'updatedEmail@me.com',
|
||||||
fullname: 'updatedFullname',
|
fullname: 'updatedFullname',
|
||||||
website: 'http://nodebb.org',
|
|
||||||
location: 'izmir',
|
|
||||||
groupTitle: 'testGroup',
|
groupTitle: 'testGroup',
|
||||||
birthday: '01/01/1980',
|
birthday: '01/01/1980',
|
||||||
signature: 'nodebb is good',
|
signature: 'nodebb is good',
|
||||||
@@ -747,7 +745,7 @@ describe('User', () => {
|
|||||||
const result = await apiUser.update({ uid: uid }, { ...data, password: '123456', invalid: 'field' });
|
const result = await apiUser.update({ uid: uid }, { ...data, password: '123456', invalid: 'field' });
|
||||||
assert.equal(result.username, 'updatedUserName');
|
assert.equal(result.username, 'updatedUserName');
|
||||||
assert.equal(result.userslug, 'updatedusername');
|
assert.equal(result.userslug, 'updatedusername');
|
||||||
assert.equal(result.location, 'izmir');
|
assert.equal(result.fullname, 'updatedFullname');
|
||||||
|
|
||||||
const userData = await db.getObject(`user:${uid}`);
|
const userData = await db.getObject(`user:${uid}`);
|
||||||
Object.keys(data).forEach((key) => {
|
Object.keys(data).forEach((key) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user