mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
fixed tests
This commit is contained in:
@@ -278,27 +278,12 @@ describe('services.UsersService', () => {
|
||||
await UsersService[func](user.id, user.username);
|
||||
throw new Error('edit was processed successfully');
|
||||
} catch (err) {
|
||||
expect(err).have.property('translation_key', 'SAME_USERNAME_PROVIDED');
|
||||
expect(err).have.property('translation_key', 'USERNAME_IN_USE');
|
||||
}
|
||||
} else {
|
||||
await UsersService[func](user.id, user.username);
|
||||
}
|
||||
});
|
||||
|
||||
it('should refuse changing the username to one already taken', async () => {
|
||||
const user = mockUsers[0];
|
||||
const otherUser = mockUsers[1];
|
||||
|
||||
// Set the user to the desired status.
|
||||
await UsersService.setUsernameStatus(user.id, okStatus);
|
||||
|
||||
try {
|
||||
await UsersService[func](user.id, otherUser.username);
|
||||
throw new Error('edit was processed successfully');
|
||||
} catch (err) {
|
||||
expect(err).have.property('translation_key', 'USERNAME_IN_USE');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user