feat: Use inbox image as avatar for the bot (#6859)
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
export default {
|
||||
computed: {
|
||||
useInboxAvatarForBot() {
|
||||
return window.chatwootWidgetDefaults.useInboxAvatarForBot;
|
||||
return this.channelConfig.enabledFeatures.includes(
|
||||
'use_inbox_avatar_for_bot'
|
||||
);
|
||||
},
|
||||
hasAConnectedAgentBot() {
|
||||
return !!window.chatwootWebChannel.hasAConnectedAgentBot;
|
||||
|
||||
@@ -22,15 +22,16 @@ const preChatFields = [
|
||||
global.chatwootWebChannel = {
|
||||
avatarUrl: 'https://test.url',
|
||||
hasAConnectedAgentBot: 'AgentBot',
|
||||
enabledFeatures: ['emoji_picker', 'attachments', 'end_conversation'],
|
||||
enabledFeatures: [
|
||||
'emoji_picker',
|
||||
'attachments',
|
||||
'end_conversation',
|
||||
'use_inbox_avatar_for_bot',
|
||||
],
|
||||
preChatFormOptions: { pre_chat_fields: preChatFields, pre_chat_message: '' },
|
||||
preChatFormEnabled: true,
|
||||
};
|
||||
|
||||
global.chatwootWidgetDefaults = {
|
||||
useInboxAvatarForBot: true,
|
||||
};
|
||||
|
||||
describe('configMixin', () => {
|
||||
test('returns config', () => {
|
||||
const Component = {
|
||||
@@ -51,7 +52,12 @@ describe('configMixin', () => {
|
||||
expect(wrapper.vm.channelConfig).toEqual({
|
||||
avatarUrl: 'https://test.url',
|
||||
hasAConnectedAgentBot: 'AgentBot',
|
||||
enabledFeatures: ['emoji_picker', 'attachments', 'end_conversation'],
|
||||
enabledFeatures: [
|
||||
'emoji_picker',
|
||||
'attachments',
|
||||
'end_conversation',
|
||||
'use_inbox_avatar_for_bot',
|
||||
],
|
||||
preChatFormOptions: {
|
||||
pre_chat_message: '',
|
||||
pre_chat_fields: preChatFields,
|
||||
|
||||
Reference in New Issue
Block a user