feat: Add assign agent option in macro (#5821)

Co-authored-by: fayazara <fayazara@gmail.com>
This commit is contained in:
Tejaswini Chile
2022-11-09 23:22:48 +05:30
committed by GitHub
parent 5febdde938
commit 7352b928da
9 changed files with 66 additions and 4 deletions

View File

@@ -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(