feat: Add warnings for existing instagram messenger channels (#11303)
This commit is contained in:
@@ -122,6 +122,13 @@ export const getters = {
|
||||
item => item.channel_type !== INBOX_TYPES.EMAIL
|
||||
);
|
||||
},
|
||||
getFacebookInboxByInstagramId: $state => instagramId => {
|
||||
return $state.records.find(
|
||||
item =>
|
||||
item.instagram_id === instagramId &&
|
||||
item.channel_type === INBOX_TYPES.FB
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
const sendAnalyticsEvent = channelType => {
|
||||
|
||||
@@ -9,6 +9,7 @@ export default [
|
||||
widget_color: null,
|
||||
website_token: null,
|
||||
enable_auto_assignment: true,
|
||||
instagram_id: 123456789,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
|
||||
@@ -43,6 +43,7 @@ describe('#getters', () => {
|
||||
widget_color: null,
|
||||
website_token: null,
|
||||
enable_auto_assignment: true,
|
||||
instagram_id: 123456789,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -64,4 +65,20 @@ describe('#getters', () => {
|
||||
isDeleting: false,
|
||||
});
|
||||
});
|
||||
|
||||
it('getFacebookInboxByInstagramId', () => {
|
||||
const state = { records: inboxList };
|
||||
expect(getters.getFacebookInboxByInstagramId(state)(123456789)).toEqual({
|
||||
id: 1,
|
||||
channel_id: 1,
|
||||
name: 'Test FacebookPage 1',
|
||||
channel_type: 'Channel::FacebookPage',
|
||||
avatar_url: 'random_image.png',
|
||||
page_id: '12345',
|
||||
widget_color: null,
|
||||
website_token: null,
|
||||
enable_auto_assignment: true,
|
||||
instagram_id: 123456789,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user