This commit is contained in:
einhornimmond 2024-11-12 16:48:04 +01:00
parent 3ce1f58a89
commit da6bdfaa61

View File

@ -9,15 +9,17 @@ describe('test publish name logic', () => {
it('alias or initials with alias set', () => {
const user = new User()
user.alias = 'alias'
user.humhubPublishName = PublishNameType.PUBLISH_NAME_ALIAS_OR_INITALS
const logic = new PublishNameLogic(user)
expect(logic.getUsername(PublishNameType.PUBLISH_NAME_ALIAS_OR_INITALS)).toBe(user.alias)
expect(logic.getUsername()).toBe(user.alias)
})
it('alias or initials with empty alias', () => {
const user = new User()
user.firstName = 'John'
user.lastName = 'Smith'
user.humhubPublishName = PublishNameType.PUBLISH_NAME_ALIAS_OR_INITALS
const logic = new PublishNameLogic(user)
expect(logic.getUsername(PublishNameType.PUBLISH_NAME_ALIAS_OR_INITALS)).toBe('JoSm')
expect(logic.getUsername()).toBe('JoSm')
})
})
})