Merge branch 'develop' into feat/v5-ui-redesign
This commit is contained in:
@@ -165,6 +165,13 @@ export const getters = {
|
||||
item.channel_type === INBOX_TYPES.INSTAGRAM
|
||||
);
|
||||
},
|
||||
getTiktokInboxByBusinessId: $state => businessId => {
|
||||
return $state.records.find(
|
||||
item =>
|
||||
item.business_id === businessId &&
|
||||
item.channel_type === INBOX_TYPES.TIKTOK
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
const sendAnalyticsEvent = channelType => {
|
||||
|
||||
@@ -71,4 +71,12 @@ export default [
|
||||
instagram_id: 123456789,
|
||||
provider: 'default',
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
channel_id: 8,
|
||||
name: 'Test TikTok 1',
|
||||
channel_type: 'Channel::Tiktok',
|
||||
business_id: 123456789,
|
||||
provider: 'default',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -27,7 +27,7 @@ describe('#getters', () => {
|
||||
|
||||
it('dialogFlowEnabledInboxes', () => {
|
||||
const state = { records: inboxList };
|
||||
expect(getters.dialogFlowEnabledInboxes(state).length).toEqual(7);
|
||||
expect(getters.dialogFlowEnabledInboxes(state).length).toEqual(8);
|
||||
});
|
||||
|
||||
it('getInbox', () => {
|
||||
@@ -95,6 +95,18 @@ describe('#getters', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('getTiktokInboxByBusinessId', () => {
|
||||
const state = { records: inboxList };
|
||||
expect(getters.getTiktokInboxByBusinessId(state)(123456789)).toEqual({
|
||||
id: 8,
|
||||
channel_id: 8,
|
||||
name: 'Test TikTok 1',
|
||||
channel_type: 'Channel::Tiktok',
|
||||
business_id: 123456789,
|
||||
provider: 'default',
|
||||
});
|
||||
});
|
||||
|
||||
describe('getFilteredWhatsAppTemplates', () => {
|
||||
it('returns empty array when inbox not found', () => {
|
||||
const state = { records: [] };
|
||||
|
||||
Reference in New Issue
Block a user