Restructure omni services and add Chatwoot research snapshot

This commit is contained in:
Ruslan Bakiev
2026-02-21 11:11:27 +07:00
parent edea7a0034
commit b73babbbf6
7732 changed files with 978203 additions and 32 deletions

View File

@@ -0,0 +1,41 @@
import actionQueryGenerator from '../actionQueryGenerator';
const testData = [
{
action_name: 'add_label',
action_params: [{ id: 'testlabel', name: 'testlabel' }],
},
{
action_name: 'assign_team',
action_params: [
{
id: 1,
name: 'sales team',
description: 'This is our internal sales team',
allow_auto_assign: true,
account_id: 1,
is_member: true,
},
],
},
];
const finalResult = [
{
action_name: 'add_label',
action_params: ['testlabel'],
},
{
action_name: 'assign_team',
action_params: [1],
},
];
describe('#actionQueryGenerator', () => {
it('returns the correct format of filter query', () => {
expect(actionQueryGenerator(testData)).toEqual(finalResult);
expect(
actionQueryGenerator(testData).every(i => Array.isArray(i.action_params))
).toBe(true);
});
});