import AgentMessage from '../AgentMessage.vue'; import UnreadMessage from '../UnreadMessage.vue'; const context = { channelConfig: { websiteName: 'GoChat' }, useInboxAvatarForBot: false, $t: key => key, }; describe('widget agent name', () => { it('uses the inbox name when a conversation message has no public sender', () => { expect( AgentMessage.computed.agentName.call({ ...context, message: {} }) ).toBe('GoChat'); }); it('uses the inbox name when an unread message has no public sender', () => { expect( UnreadMessage.computed.agentName.call({ ...context, sender: {}, isSenderExist: UnreadMessage.methods.isSenderExist, }) ).toBe('GoChat'); }); });