Files
gochat/frontend/app/javascript/widget/components/specs/agentName.spec.js
T
2026-08-23 20:59:10 +08:00

27 lines
729 B
JavaScript

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');
});
});