Fix parsing of displayName
Currently, we only have one field for the name. The first part is first name. The rest is last name. Obviously, this won't work in all cases but is the best we can do for the moment.
This commit is contained in:
@@ -623,4 +623,18 @@ describe('User', function () {
|
||||
expect(result.length).to.be(0); // should have been removed by mandatory 2fa setting change
|
||||
});
|
||||
});
|
||||
|
||||
describe('parseDisplayName', function () {
|
||||
it('parses names', function () {
|
||||
const names = [
|
||||
{ in: 'James', out: { firstName: 'James', lastName: '', middleName: '' } },
|
||||
{ in: 'James Anderson', out: { firstName: 'James', lastName: 'Anderson', middleName: '' } },
|
||||
{ in: 'James Philip Anderson', out: { firstName: 'James', lastName: 'Philip Anderson', middleName: '' } },
|
||||
];
|
||||
|
||||
for (const name of names) {
|
||||
expect(users.parseDisplayName(name.in)).to.eql(name.out);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user