mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-03 04:27:53 +00:00
feat: Add assign agent option in macro (#5821)
Co-authored-by: fayazara <fayazara@gmail.com>
This commit is contained in:
@@ -4,9 +4,10 @@ import {
|
||||
resolveLabels,
|
||||
resolveTeamIds,
|
||||
getFileName,
|
||||
resolveAgents,
|
||||
} from '../../routes/dashboard/settings/macros/macroHelper';
|
||||
import { MACRO_ACTION_TYPES } from '../../routes/dashboard/settings/macros/constants';
|
||||
import { teams, labels, files } from './macrosFixtures';
|
||||
import { teams, labels, files, agents } from './macrosFixtures';
|
||||
|
||||
describe('#emptyMacro', () => {
|
||||
const defaultMacro = {
|
||||
@@ -52,6 +53,13 @@ describe('#resolveLabels', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#resolveAgents', () => {
|
||||
it('resolves agents names from ids and returns a joined string', () => {
|
||||
const resolvedAgents = 'John Doe';
|
||||
expect(resolveAgents(agents, [1])).toEqual(resolvedAgents);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getFileName', () => {
|
||||
it('returns the correct file name from the list of files', () => {
|
||||
expect(getFileName(files[0].blob_id, 'send_attachment', files)).toEqual(
|
||||
|
||||
Reference in New Issue
Block a user