fix(HH-552): hide bot fallback from widget replies (#131)
Co-authored-by: Rogee <rogee@ipao.vip>
This commit is contained in:
@@ -76,11 +76,7 @@ export default {
|
||||
return this.message.additional_attributes.sender_name;
|
||||
}
|
||||
|
||||
if (this.useInboxAvatarForBot) {
|
||||
return this.channelConfig.websiteName;
|
||||
}
|
||||
|
||||
return this.$t('UNREAD_VIEW.BOT');
|
||||
return this.channelConfig.websiteName || '';
|
||||
},
|
||||
avatarUrl() {
|
||||
const displayImage = this.useInboxAvatarForBot
|
||||
|
||||
@@ -63,10 +63,7 @@ export default {
|
||||
const { available_name: availableName, name } = this.sender;
|
||||
return availableName || name || '';
|
||||
}
|
||||
if (this.useInboxAvatarForBot) {
|
||||
return this.channelConfig.websiteName;
|
||||
}
|
||||
return this.$t('UNREAD_VIEW.BOT');
|
||||
return this.channelConfig.websiteName || '';
|
||||
},
|
||||
availabilityStatus() {
|
||||
if (this.isSenderExist(this.sender)) {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
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');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user