diff --git a/packages/contact-center/cc-components/src/components/task/CallControlCAD/call-control-cad.tsx b/packages/contact-center/cc-components/src/components/task/CallControlCAD/call-control-cad.tsx index 23a86b8d8..7e690ad74 100644 --- a/packages/contact-center/cc-components/src/components/task/CallControlCAD/call-control-cad.tsx +++ b/packages/contact-center/cc-components/src/components/task/CallControlCAD/call-control-cad.tsx @@ -165,7 +165,7 @@ const CallControlCADComponent: React.FC = (props) =>
{renderCustomerName()}
- + {currentMediaType.labelName} -
diff --git a/packages/contact-center/cc-components/src/components/task/Task/index.tsx b/packages/contact-center/cc-components/src/components/task/Task/index.tsx index 564c3b72a..58870afb7 100644 --- a/packages/contact-center/cc-components/src/components/task/Task/index.tsx +++ b/packages/contact-center/cc-components/src/components/task/Task/index.tsx @@ -67,6 +67,7 @@ const Task: React.FC = ({ type={selected ? 'body-large-bold' : 'body-large-medium'} className={taskData.titleClassName} id={taskData.isNonVoiceMedia ? taskData.tooltipTriggerId : undefined} + data-testid="task:title" > {title} @@ -145,7 +146,7 @@ const Task: React.FC = ({ data-testid={`${interactionId}-handle-time`} > Handle Time: {' '} - + )} diff --git a/packages/contact-center/cc-components/tests/components/task/CallControlCAD/__snapshots__/call-control-cad.snapshot.tsx.snap b/packages/contact-center/cc-components/tests/components/task/CallControlCAD/__snapshots__/call-control-cad.snapshot.tsx.snap index 1a564b737..c924a5abb 100644 --- a/packages/contact-center/cc-components/tests/components/task/CallControlCAD/__snapshots__/call-control-cad.snapshot.tsx.snap +++ b/packages/contact-center/cc-components/tests/components/task/CallControlCAD/__snapshots__/call-control-cad.snapshot.tsx.snap @@ -28,6 +28,7 @@ exports[`CallControlCADComponent Snapshots should handle edge cases and control > Voice - @@ -213,6 +214,7 @@ exports[`CallControlCADComponent Snapshots should handle edge cases and control > Voice - @@ -362,6 +364,7 @@ exports[`CallControlCADComponent Snapshots should handle edge cases and control > Voice - @@ -639,6 +642,7 @@ exports[`CallControlCADComponent Snapshots should render basic call states and m > Chat - @@ -916,6 +920,7 @@ exports[`CallControlCADComponent Snapshots should render basic call states and m > Voice - @@ -1203,6 +1208,7 @@ exports[`CallControlCADComponent Snapshots should render basic call states and m > Voice - @@ -1480,6 +1486,7 @@ exports[`CallControlCADComponent Snapshots should render basic call states and m > Social - @@ -1758,6 +1765,7 @@ exports[`CallControlCADComponent Snapshots should render consultation and wrapup > Voice - @@ -1943,6 +1951,7 @@ exports[`CallControlCADComponent Snapshots should render consultation and wrapup > Voice - @@ -2048,6 +2057,7 @@ exports[`CallControlCADComponent Snapshots should render consultation and wrapup > Voice - @@ -2379,6 +2389,7 @@ exports[`CallControlCADComponent Snapshots should render consultation and wrapup > Voice - diff --git a/packages/contact-center/cc-components/tests/components/task/IncomingTask/__snapshots__/incoming-task.snapshot.tsx.snap b/packages/contact-center/cc-components/tests/components/task/IncomingTask/__snapshots__/incoming-task.snapshot.tsx.snap index a06c9a034..ca50d7bdf 100644 --- a/packages/contact-center/cc-components/tests/components/task/IncomingTask/__snapshots__/incoming-task.snapshot.tsx.snap +++ b/packages/contact-center/cc-components/tests/components/task/IncomingTask/__snapshots__/incoming-task.snapshot.tsx.snap @@ -31,6 +31,7 @@ exports[`IncomingTaskComponent Actions should call acceptTask when accept button > @@ -142,6 +143,7 @@ exports[`IncomingTaskComponent Actions should call acceptTask when accept button > @@ -253,6 +255,7 @@ exports[`IncomingTaskComponent Actions should call declineTask when decline butt > @@ -364,6 +367,7 @@ exports[`IncomingTaskComponent Actions should call declineTask when decline butt > @@ -480,6 +484,7 @@ exports[`IncomingTaskComponent Rendering with Incoming Tasks should render digit @@ -705,6 +711,7 @@ exports[`IncomingTaskComponent Rendering with Incoming Tasks should render multi > @@ -798,6 +805,7 @@ exports[`IncomingTaskComponent Rendering with Incoming Tasks should render multi @@ -1141,6 +1151,7 @@ exports[`IncomingTaskComponent Rendering with Incoming Tasks should render telep > diff --git a/packages/contact-center/cc-components/tests/components/task/TaskList/__snapshots__/task-list.snapshot.tsx.snap b/packages/contact-center/cc-components/tests/components/task/TaskList/__snapshots__/task-list.snapshot.tsx.snap index 58023a027..f479f997f 100644 --- a/packages/contact-center/cc-components/tests/components/task/TaskList/__snapshots__/task-list.snapshot.tsx.snap +++ b/packages/contact-center/cc-components/tests/components/task/TaskList/__snapshots__/task-list.snapshot.tsx.snap @@ -35,6 +35,7 @@ exports[`TaskListComponent Actions should call acceptTask when accept button is > @@ -151,6 +152,7 @@ exports[`TaskListComponent Actions should call acceptTask when accept button is > @@ -267,6 +269,7 @@ exports[`TaskListComponent Actions should call declineTask when decline button i > @@ -383,6 +386,7 @@ exports[`TaskListComponent Actions should call declineTask when decline button i > @@ -499,6 +503,7 @@ exports[`TaskListComponent Actions should call onTaskSelect when task is clicked > @@ -576,6 +581,7 @@ exports[`TaskListComponent Actions should call onTaskSelect when task is clicked > @@ -653,6 +659,7 @@ exports[`TaskListComponent Actions should handle task selection between multiple > @@ -760,6 +767,7 @@ exports[`TaskListComponent Actions should handle task selection between multiple @@ -966,6 +975,7 @@ exports[`TaskListComponent Actions should handle task selection between multiple @@ -1259,6 +1271,7 @@ exports[`TaskListComponent Rendering with Tasks should render multiple tasks wit @@ -1567,6 +1582,7 @@ exports[`TaskListComponent Rendering with Tasks should render telephony incoming > @@ -1664,6 +1680,7 @@ exports[`TaskListComponent Rendering with Tasks should show selected state with > diff --git a/packages/contact-center/cc-components/tests/components/task/task/__snapshots__/task.snapshot.tsx.snap b/packages/contact-center/cc-components/tests/components/task/task/__snapshots__/task.snapshot.tsx.snap index 228618ae9..da7f9804e 100644 --- a/packages/contact-center/cc-components/tests/components/task/task/__snapshots__/task.snapshot.tsx.snap +++ b/packages/contact-center/cc-components/tests/components/task/task/__snapshots__/task.snapshot.tsx.snap @@ -31,6 +31,7 @@ exports[`Task Component Snapshots Actions should handle accept task action corre > @@ -123,6 +124,7 @@ exports[`Task Component Snapshots Actions should handle accept task action corre > @@ -215,6 +217,7 @@ exports[`Task Component Snapshots Actions should handle accept task action corre > @@ -307,6 +310,7 @@ exports[`Task Component Snapshots Actions should handle accept task action corre > @@ -399,6 +403,7 @@ exports[`Task Component Snapshots Actions should handle accept task action corre > @@ -510,6 +515,7 @@ exports[`Task Component Snapshots Actions should handle accept task action corre > @@ -621,6 +627,7 @@ exports[`Task Component Snapshots Actions should handle decline task action corr > @@ -713,6 +720,7 @@ exports[`Task Component Snapshots Actions should handle decline task action corr > @@ -805,6 +813,7 @@ exports[`Task Component Snapshots Actions should handle decline task action corr > @@ -916,6 +925,7 @@ exports[`Task Component Snapshots Actions should handle decline task action corr > @@ -1027,6 +1037,7 @@ exports[`Task Component Snapshots Actions should handle decline task action corr > @@ -1138,6 +1149,7 @@ exports[`Task Component Snapshots Actions should handle task selection action co > @@ -1210,6 +1222,7 @@ exports[`Task Component Snapshots Actions should handle task selection action co > @@ -1282,6 +1295,7 @@ exports[`Task Component Snapshots Actions should handle task selection action co > @@ -1393,6 +1407,7 @@ exports[`Task Component Snapshots Actions should handle task selection action co > @@ -1504,6 +1519,7 @@ exports[`Task Component Snapshots Actions should handle task selection action co > @@ -1615,6 +1631,7 @@ exports[`Task Component Snapshots Actions should handle task selection action co > @@ -1726,6 +1743,7 @@ exports[`Task Component Snapshots Actions should handle task selection action co > @@ -1837,6 +1855,7 @@ exports[`Task Component Snapshots Actions should handle task selection action co > @@ -1948,6 +1967,7 @@ exports[`Task Component Snapshots Actions should handle task selection action co > @@ -2020,6 +2040,7 @@ exports[`Task Component Snapshots Actions should handle task selection action co > @@ -2093,6 +2114,7 @@ exports[`Task Component Snapshots Actions should handle task selection action co @@ -2354,6 +2378,7 @@ exports[`Task Component Snapshots Actions should handle task selection action co > @@ -2426,6 +2451,7 @@ exports[`Task Component Snapshots Actions should handle task selection action co > @@ -2490,6 +2516,7 @@ exports[`Task Component Snapshots Actions should handle task selection action co > @@ -2554,6 +2581,7 @@ exports[`Task Component Snapshots Rendering should handle default prop values an > @@ -2623,6 +2651,7 @@ exports[`Task Component Snapshots Rendering should handle default prop values an > @@ -2715,6 +2744,7 @@ exports[`Task Component Snapshots Rendering should handle default prop values an > @@ -2787,6 +2817,7 @@ exports[`Task Component Snapshots Rendering should handle default prop values an > @@ -2859,6 +2890,7 @@ exports[`Task Component Snapshots Rendering should handle default prop values an > @@ -2949,6 +2981,7 @@ exports[`Task Component Snapshots Rendering should handle default prop values an > @@ -3018,6 +3051,7 @@ exports[`Task Component Snapshots Rendering should render accept and decline but > @@ -3129,6 +3163,7 @@ exports[`Task Component Snapshots Rendering should render accept and decline but > @@ -3221,6 +3256,7 @@ exports[`Task Component Snapshots Rendering should render accept and decline but > @@ -3313,6 +3349,7 @@ exports[`Task Component Snapshots Rendering should render media type icons and b > @@ -3674,6 +3714,7 @@ exports[`Task Component Snapshots Rendering should render media type icons and b > @@ -3832,6 +3874,7 @@ exports[`Task Component Snapshots Rendering should render state, queue, and time > @@ -3908,6 +3951,7 @@ exports[`Task Component Snapshots Rendering should render state, queue, and time @@ -4352,6 +4400,7 @@ exports[`Task Component Snapshots Rendering should render titles and tooltips co > @@ -4554,6 +4603,7 @@ exports[`Task Component Snapshots Rendering should render titles and tooltips co > @@ -4626,6 +4676,7 @@ exports[`Task Component Snapshots Rendering should render titles and tooltips co > = { + Call: 'telephony', + Email: 'email', + Chat: 'chat', +}; + +/** + * Reads the handle time of ith task in the task list. + * @param page Playwright Page object + * @param index Index of the task in the task list (default is 0 for the first task) + * @returns returns the handle time in seconds + */ + +async function getCurrentHandleTime(page: Page, index: number = 0): Promise { + // find the task list item and read its interactionId + const taskListItem = page.getByTestId('task-list').getByRole('listitem').nth(index); + const interactionId = await taskListItem.getAttribute('id'); + + // read the dynamic handle-time test-id + const full = await page.getByTestId(`${interactionId}-handle-time`).textContent(); + + // 2. Pull out the MM:SS via regex + const match = full?.match(/(\d{2}:\d{2})/); + const timer = match ? match[1] : null; + + // 3. (Optional) convert to total seconds + const [m, s] = timer!.split(':').map(Number); + return m * 60 + s; +} + +/** + * wait for and accept a specific task in the task list. + * @param page : Playwright Page object + * @param testId : testId of the task to accept + * @param extensionMode : extension mode flag + * @param extensionPage : extension page if in extension mode + */ + +async function waitForAndAcceptSpecificTask(page: Page, testId: string): Promise { + const timeoutMs = 60000, + pollInterval = 2000; + const start = Date.now(); + const type = testId.split('-').pop(); + while (Date.now() - start < timeoutMs) { + const taskDiv = page.getByTestId(testId).first(); + const isVisible = await taskDiv.isVisible().catch(() => false); + if (isVisible) { + const acceptButton = taskDiv.getByTestId('task:accept-button').first(); + await expect(acceptButton).toBeVisible({timeout: 5000}); + await acceptButton.click({timeout: 3000}); + + return; + } + await page.waitForTimeout(pollInterval); + } + throw new Error(`No incoming task found for ${testId} after ${timeoutMs / 1000} seconds`); +} + +async function getTaskType(): Promise { + const callTimer = page.getByTestId('cc-cad:call-timer').first(); + const fullText = await callTimer.textContent(); + const mediaLabel = fullText!.split(' - ')[0].trim(); + return mediaLabel; +} + +function setupConsoleLogging(page: Page): () => void { + capturedLogs.length = 0; + + const consoleHandler = (msg) => { + const logText = msg.text(); + if (logText.startsWith('onTaskSelected invoked for task with title :') && logText.includes(', and mediaType :')) { + capturedLogs.push(logText); + } + }; + + page.on('console', consoleHandler); + return () => page.off('console', consoleHandler); +} + +function escapeForRegExp(str?: string): string { + if (!str) { + return ''; + } + return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); +} + +async function waitForConsoleLogs( + logs: string[], + title: string, + mediaType: string, + timeoutMs = 15000, + intervalMs = 500 +): Promise { + const escTitle = escapeForRegExp(title!); + const escMedia = escapeForRegExp(mediaType!); + const pattern = new RegExp( + '^onTaskSelected invoked for task with title : ' + escTitle + ', and mediaType : ' + escMedia + '$' + ); + + const start = Date.now(); + while (Date.now() - start < timeoutMs) { + if (logs.some((log) => pattern.test(log))) return; + await new Promise((r) => setTimeout(r, intervalMs)); + } + + throw new Error(`Timed out waiting for console log matching "${pattern.source}"`); +} + +test.describe('Task List Tests for different types of Task', () => { + test.beforeEach(() => { + capturedLogs.length = 0; + }); + + test.beforeAll(async ({browser}) => { + context = await browser.newContext(); + context2 = await browser.newContext(); + page = await context.newPage(); + callerpage = await context2.newPage(); + chatPage = await context.newPage(); + setupConsoleLogging(page); + + await Promise.all([ + (async () => { + await loginExtension(callerpage, process.env.PW_AGENT2_USERNAME, process.env.PW_PASSWORD); + })(), + (async () => { + await pageSetup(page, LOGIN_MODE.DESKTOP, 'AGENT1'); + })(), + ]); + }); + + test('Verify Task List for incoming Call', async () => { + await createCallTask(callerpage); + await changeUserState(page, USER_STATES.AVAILABLE); + let incomingTaskDiv = page.getByTestId('samples:incoming-task-telephony').first(); + await incomingTaskDiv.waitFor({state: 'visible', timeout: 40000}); + await page.waitForTimeout(1000); + const taskListItem = page.getByTestId('task-list').getByRole('listitem').first(); + expect(taskListItem).toBeVisible(); + const taskListAcceptButton = taskListItem.getByTestId('task:accept-button').first(); + const taskListDeclineButton = taskListItem.getByTestId('task:decline-button').first(); + const title = await incomingTaskDiv.getByTestId('task:title').first().textContent(); + expect(await taskListItem.getByTestId('task:title').textContent()).toBe(title); + await expect(incomingTaskDiv.getByTestId('task:accept-button')).toBeVisible(); + await expect(incomingTaskDiv.getByTestId('task:decline-button')).toBeVisible(); + await expect(taskListAcceptButton).toBeVisible(); + await expect(taskListDeclineButton).toBeVisible(); + await taskListAcceptButton.click(); + await page.waitForTimeout(1000); + await expect(taskListAcceptButton).not.toBeVisible(); + await expect(taskListDeclineButton).not.toBeVisible(); + await page.waitForTimeout(5000); + try { + await verifyTaskControls(page, TASK_TYPES.CALL); + } catch (error) { + throw new Error(`Call control buttons verification failed: ${error.message}`); + } + await waitForState(page, USER_STATES.ENGAGED); + await taskListItem.click(); + await waitForConsoleLogs(capturedLogs, title, 'telephony'); + + // now use interactionId for dynamic assertions + const interactionId = await taskListItem.getAttribute('id'); + await expect(taskListItem.locator('[icon-name="handset-filled"]')).toBeVisible(); + await expect(page.getByTestId(`${interactionId}-state`)).toHaveText('Connected'); + await expect(page.getByTestId(`${interactionId}-handle-time`)).toBeVisible(); + await page.getByTestId('call-control:end-call').first().waitFor({state: 'visible', timeout: 5000}); + await page.getByTestId('call-control:end-call').first().click(); + await page.waitForTimeout(500); + await submitWrapup(page, WRAPUP_REASONS.SALE); + await waitForState(page, USER_STATES.AVAILABLE); + }); + + test('Verify Task List for incoming Chat Task', async () => { + await createChatTask(chatPage); + await changeUserState(page, USER_STATES.AVAILABLE); + const incomingTaskDiv = page.getByTestId('samples:incoming-task-chat').first(); + await incomingTaskDiv.waitFor({state: 'visible', timeout: 60000}); + await page.waitForTimeout(1000); + const taskListItem = page.getByTestId('task-list').getByRole('listitem').first(); + expect(taskListItem).toBeVisible(); + const taskListAcceptButton = taskListItem.getByTestId('task:accept-button').first(); + const taskListDeclineButton = taskListItem.getByTestId('task:decline-button').first(); + const title = await incomingTaskDiv.getByTestId('task:title').textContent(); + expect(await taskListItem.getByTestId('task:title').textContent()).toBe(title); + await expect(incomingTaskDiv.getByTestId('task:accept-button')).toBeVisible(); + await expect(incomingTaskDiv.getByTestId('task:decline-button')).not.toBeVisible(); + await expect(taskListAcceptButton).toBeVisible(); + await expect(taskListDeclineButton).not.toBeVisible(); + await taskListAcceptButton.click(); + await page.waitForTimeout(1000); + await waitForState(page, USER_STATES.ENGAGED); + const prevtimer = await getCurrentHandleTime(page); + await page.waitForTimeout(5000); + const currentTimer = await getCurrentHandleTime(page); + expect(currentTimer).toBeGreaterThan(prevtimer); + expect(Math.abs(currentTimer - prevtimer + 1)).toBeGreaterThanOrEqual(5); + try { + await verifyTaskControls(page, TASK_TYPES.CHAT); + } catch (error) { + throw new Error(`Call control buttons verification failed: ${error.message}`); + } + await waitForConsoleLogs(capturedLogs, title, 'chat'); + await expect(taskListAcceptButton).not.toBeVisible(); + await expect(taskListDeclineButton).not.toBeVisible(); + expect(await taskListItem.getByTestId('task:title').textContent()).toBe(title); + await expect(taskListItem.locator('[icon-name="chat-filled"]')).toBeVisible(); + await expect(taskListItem.getByTestId('task:item-state')).toHaveText('Connected'); + await expect(taskListItem.getByTestId('task:handle-time')).toBeVisible(); + await page.getByTestId('call-control:end-call').first().waitFor({state: 'visible', timeout: 5000}); + await page.getByTestId('call-control:end-call').first().click(); + await page.waitForTimeout(2000); + await submitWrapup(page, WRAPUP_REASONS.SALE); + await waitForState(page, USER_STATES.AVAILABLE); + }); + + test('Verify Task List for incoming Email Task', async () => { + await createEmailTask(); + await changeUserState(page, USER_STATES.AVAILABLE); + const incomingTaskDiv = page.getByTestId('samples:incoming-task-email').first(); + await incomingTaskDiv.waitFor({state: 'visible', timeout: 60000}); + await page.waitForTimeout(1000); + const taskListItem = page.getByTestId('task-list').getByRole('listitem').first(); + expect(taskListItem).toBeVisible(); + const taskListAcceptButton = taskListItem.getByTestId('task:accept-button').first(); + const taskListDeclineButton = taskListItem.getByTestId('task:decline-button').first(); + const title = await incomingTaskDiv.getByTestId('task:title').textContent(); + expect(await taskListItem.getByTestId('task:title').textContent()).toBe(title); + await expect(incomingTaskDiv.getByTestId('task:accept-button')).toBeVisible(); + await expect(incomingTaskDiv.getByTestId('task:decline-button')).not.toBeVisible(); + await expect(taskListAcceptButton).toBeVisible(); + await expect(taskListDeclineButton).not.toBeVisible(); + await taskListAcceptButton.click(); + await page.waitForTimeout(1000); + const prevtimer = await getCurrentHandleTime(page); + await page.waitForTimeout(5000); + + const currentTimer = await getCurrentHandleTime(page); + expect(currentTimer).toBeGreaterThan(prevtimer); + expect(Math.abs(currentTimer - prevtimer + 1)).toBeGreaterThanOrEqual(5); + + try { + await verifyTaskControls(page, TASK_TYPES.EMAIL); + } catch (error) { + throw new Error(`Call control buttons verification failed: ${error.message}`); + } + + await expect(taskListAcceptButton).not.toBeVisible(); + await expect(taskListDeclineButton).not.toBeVisible(); + await waitForState(page, USER_STATES.ENGAGED); + await waitForConsoleLogs(capturedLogs, title, 'email'); + expect(await taskListItem.getByTestId('task:title').textContent()).toBe(title); + await expect(taskListItem.locator('[icon-name="email-filled"]')).toBeVisible(); + await expect(taskListItem.getByTestId('task:item-state')).toHaveText('Connected'); + await expect(taskListItem.getByTestId('task:handle-time')).toBeVisible(); + await page.getByTestId('call-control:end-call').first().waitFor({state: 'visible', timeout: 5000}); + await page.getByTestId('call-control:end-call').first().click(); + await page.waitForTimeout(2000); + await submitWrapup(page, WRAPUP_REASONS.SALE); + await waitForState(page, USER_STATES.AVAILABLE); + }); + + test('Task List Test with Multiple Taks', async () => { + await changeUserState(page, USER_STATES.MEETING); + await waitForState(page, USER_STATES.MEETING); + await Promise.all([createCallTask(callerpage), createChatTask(chatPage), createEmailTask()]); + + await changeUserState(page, USER_STATES.AVAILABLE); + + await Promise.all([ + waitForAndAcceptSpecificTask(page, 'samples:incoming-task-telephony'), + waitForAndAcceptSpecificTask(page, 'samples:incoming-task-chat'), + waitForAndAcceptSpecificTask(page, 'samples:incoming-task-email'), + ]); + await page.waitForTimeout(3000); + + for (let i = 0; i < 3; i++) { + const taskListItem = page.getByTestId('task-list').getByRole('listitem').nth(i); + + await taskListItem.waitFor({state: 'visible', timeout: 5000}); + expect(taskListItem).toBeVisible(); + await taskListItem.click(); + const prevtimer = await getCurrentHandleTime(page, i); + await page.waitForTimeout(5000); + const currentTimer = await getCurrentHandleTime(page, i); + expect(currentTimer).toBeGreaterThan(prevtimer); + expect(Math.abs(currentTimer - prevtimer + 1)).toBeGreaterThanOrEqual(5); + const inferredType = await getTaskType(); + try { + await verifyTaskControls(page, inferredType); + } catch (error) { + throw new Error(`Call control buttons verification failed: ${error.message}`); + } + + await waitForConsoleLogs( + capturedLogs, + await taskListItem.getByTestId('task:title').textContent()!, + labelToMediaType[inferredType] + ); + capturedLogs.length = 0; + } + + await handleStrayTasks(page); + }); + + test.afterAll(async () => { + await context.close(); + await context2.close(); + }); +}); diff --git a/widgets-samples/cc/samples-cc-react-app/src/App.tsx b/widgets-samples/cc/samples-cc-react-app/src/App.tsx index 245a23cf1..39fc34a8c 100644 --- a/widgets-samples/cc/samples-cc-react-app/src/App.tsx +++ b/widgets-samples/cc/samples-cc-react-app/src/App.tsx @@ -166,6 +166,7 @@ const onTaskDeclined = (task,reason) => { const onTaskSelected = ({task, isClicked}) => { console.log('onTaskSelected invoked for task:', task, 'isClicked:', isClicked); + console.log(`onTaskSelected invoked for task with title : ${task?.data?.interaction?.callAssociatedDetails?.ani}, and mediaType : ${task?.data?.mediaType}`); }; const onHoldResume = ({isHeld, task}) => {