@@ -78,9 +78,11 @@ export const getters = {
|
||||
item => item.channel_type === INBOX_TYPES.TWILIO
|
||||
);
|
||||
},
|
||||
getTwilioSMSInboxes($state) {
|
||||
getSMSInboxes($state) {
|
||||
return $state.records.filter(
|
||||
item => item.channel_type === INBOX_TYPES.TWILIO && item.medium === 'sms'
|
||||
item =>
|
||||
item.channel_type === INBOX_TYPES.SMS ||
|
||||
(item.channel_type === INBOX_TYPES.TWILIO && item.medium === 'sms')
|
||||
);
|
||||
},
|
||||
dialogFlowEnabledInboxes($state) {
|
||||
|
||||
@@ -55,4 +55,11 @@ export default [
|
||||
website_token: 'randomid125',
|
||||
enable_auto_assignment: true,
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
channel_id: 6,
|
||||
name: 'Test Widget 6',
|
||||
channel_type: 'Channel::Sms',
|
||||
provider: 'default',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -19,14 +19,14 @@ describe('#getters', () => {
|
||||
expect(getters.getTwilioInboxes(state).length).toEqual(1);
|
||||
});
|
||||
|
||||
it('getTwilioSMSInboxes', () => {
|
||||
it('getSMSInboxes', () => {
|
||||
const state = { records: inboxList };
|
||||
expect(getters.getTwilioSMSInboxes(state).length).toEqual(1);
|
||||
expect(getters.getSMSInboxes(state).length).toEqual(2);
|
||||
});
|
||||
|
||||
it('dialogFlowEnabledInboxes', () => {
|
||||
const state = { records: inboxList };
|
||||
expect(getters.dialogFlowEnabledInboxes(state).length).toEqual(5);
|
||||
expect(getters.dialogFlowEnabledInboxes(state).length).toEqual(6);
|
||||
});
|
||||
|
||||
it('getInbox', () => {
|
||||
|
||||
Reference in New Issue
Block a user