@webex/contact-center 3.12.0-next.13 → 3.12.0-next.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/services/task/index.js +7 -2
- package/dist/services/task/index.js.map +1 -1
- package/dist/webex.js +1 -1
- package/package.json +8 -8
- package/src/services/task/index.ts +7 -2
- package/test/unit/spec/services/task/index.ts +21 -0
- package/umd/contact-center.min.js +2 -2
- package/umd/contact-center.min.js.map +1 -1
|
@@ -691,6 +691,27 @@ describe('Task', () => {
|
|
|
691
691
|
);
|
|
692
692
|
});
|
|
693
693
|
|
|
694
|
+
it('should hold using mediaResourceId from interaction.media after recording event wipes top-level mediaResourceId', async () => {
|
|
695
|
+
// Set a DIFFERENT top-level mediaResourceId so we can distinguish the two sources
|
|
696
|
+
const staleTopLevelId = 'stale-top-level-media-resource-id';
|
|
697
|
+
const correctMediaId = task.data.interaction.media[task.data.interaction.mainInteractionId].mediaResourceId;
|
|
698
|
+
task.data.mediaResourceId = staleTopLevelId;
|
|
699
|
+
|
|
700
|
+
// Simulate recording event wiping top-level mediaResourceId (as reconcileData does)
|
|
701
|
+
delete task.data.mediaResourceId;
|
|
702
|
+
|
|
703
|
+
const expectedResponse: TaskResponse = {data: {interactionId: taskId}} as AgentContact;
|
|
704
|
+
contactMock.hold.mockResolvedValue(expectedResponse);
|
|
705
|
+
|
|
706
|
+
await task.hold();
|
|
707
|
+
|
|
708
|
+
// hold() should read from interaction.media, not the (now deleted) top-level field
|
|
709
|
+
expect(contactMock.hold).toHaveBeenCalledWith({
|
|
710
|
+
interactionId: taskId,
|
|
711
|
+
data: {mediaResourceId: correctMediaId},
|
|
712
|
+
});
|
|
713
|
+
});
|
|
714
|
+
|
|
694
715
|
it('should handle errors in hold method', async () => {
|
|
695
716
|
const error = {details: (global as any).makeFailure('Hold Failed')};
|
|
696
717
|
contactMock.hold.mockImplementation(() => {
|