mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
Removes duplicate func and adds tests.
This commit is contained in:
@@ -178,6 +178,25 @@ describe('services.UsersService', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#setDisplayName', () => {
|
||||
it('should set the display name to a new unique one', () => {
|
||||
return UsersService
|
||||
.setDisplayName(mockUsers[0].id, 'maria')
|
||||
.then(() => UsersService.findById(mockUsers[0].id))
|
||||
.then((user) => {
|
||||
expect(user).to.have.property('displayName', 'maria');
|
||||
});
|
||||
});
|
||||
|
||||
it('should return an error when the displayName is not unique', () => {
|
||||
return UsersService
|
||||
.setDisplayName(mockUsers[0].id, 'marvel')
|
||||
.catch((error) => {
|
||||
expect(error).to.not.be.null;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('#ban', () => {
|
||||
it('should set the status to banned', () => {
|
||||
return UsersService
|
||||
|
||||
Reference in New Issue
Block a user