@microsoft/omnichannel-chat-widget 1.5.1-main.76c6a71 → 1.5.1-main.7897747

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.
Files changed (96) hide show
  1. package/lib/cjs/common/Constants.js +31 -8
  2. package/lib/cjs/common/telemetry/TelemetryConstants.js +3 -2
  3. package/lib/cjs/common/utils.js +2 -1
  4. package/lib/cjs/components/livechatwidget/common/chatDisconnectHelper.js +31 -16
  5. package/lib/cjs/components/livechatwidget/common/endChat.js +41 -7
  6. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +8 -4
  7. package/lib/cjs/components/livechatwidget/common/startChat.js +16 -84
  8. package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +220 -0
  9. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +52 -16
  10. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
  11. package/lib/cjs/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +82 -0
  12. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneGeneralStyleProps.js +17 -0
  13. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconImageProps.js +17 -0
  14. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconStyleProps.js +15 -0
  15. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneSubtitleStyleProps.js +17 -0
  16. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneTitleStyleProps.js +17 -0
  17. package/lib/cjs/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneControlProps.js +1 -0
  18. package/lib/cjs/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneProps.js +1 -0
  19. package/lib/cjs/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneStyleProps.js +1 -0
  20. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +2 -11
  21. package/lib/cjs/contexts/common/ConversationState.js +1 -0
  22. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +37 -36
  23. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +4 -1
  24. package/lib/cjs/contexts/common/StartChatFailureType.js +13 -0
  25. package/lib/cjs/contexts/createReducer.js +8 -0
  26. package/lib/cjs/controller/componentController.js +5 -1
  27. package/lib/esm/common/Constants.js +26 -6
  28. package/lib/esm/common/telemetry/TelemetryConstants.js +3 -2
  29. package/lib/esm/common/utils.js +3 -2
  30. package/lib/esm/components/livechatwidget/common/chatDisconnectHelper.js +31 -16
  31. package/lib/esm/components/livechatwidget/common/endChat.js +40 -7
  32. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +8 -4
  33. package/lib/esm/components/livechatwidget/common/startChat.js +17 -85
  34. package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +213 -0
  35. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +55 -19
  36. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
  37. package/lib/esm/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +71 -0
  38. package/lib/esm/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneGeneralStyleProps.js +10 -0
  39. package/lib/esm/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconImageProps.js +10 -0
  40. package/lib/esm/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconStyleProps.js +8 -0
  41. package/lib/esm/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneSubtitleStyleProps.js +10 -0
  42. package/lib/esm/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneTitleStyleProps.js +10 -0
  43. package/lib/esm/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneControlProps.js +1 -0
  44. package/lib/esm/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneProps.js +1 -0
  45. package/lib/esm/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneStyleProps.js +1 -0
  46. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +2 -11
  47. package/lib/esm/contexts/common/ConversationState.js +1 -0
  48. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +37 -36
  49. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +4 -1
  50. package/lib/esm/contexts/common/StartChatFailureType.js +6 -0
  51. package/lib/esm/contexts/createReducer.js +8 -0
  52. package/lib/esm/controller/componentController.js +3 -0
  53. package/lib/types/common/Constants.d.ts +29 -4
  54. package/lib/types/common/telemetry/TelemetryConstants.d.ts +2 -1
  55. package/lib/types/components/livechatwidget/common/endChat.d.ts +4 -3
  56. package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +5 -0
  57. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts +1 -0
  58. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +1 -1
  59. package/lib/types/components/startchaterrorpanestateful/StartChatErrorPaneStateful.d.ts +3 -0
  60. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneGeneralStyleProps.d.ts +2 -0
  61. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconImageProps.d.ts +2 -0
  62. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconStyleProps.d.ts +2 -0
  63. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneSubtitleStyleProps.d.ts +2 -0
  64. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneTitleStyleProps.d.ts +2 -0
  65. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneClassNames.d.ts +5 -0
  66. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneComponentOverrides.d.ts +6 -0
  67. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneControlProps.d.ts +14 -0
  68. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneProps.d.ts +8 -0
  69. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneStyleProps.d.ts +10 -0
  70. package/lib/types/contexts/common/ConversationState.d.ts +2 -1
  71. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +3 -0
  72. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +37 -36
  73. package/lib/types/contexts/common/StartChatFailureType.d.ts +5 -0
  74. package/lib/types/controller/componentController.d.ts +1 -0
  75. package/package.json +5 -5
  76. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +0 -71
  77. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +0 -56
  78. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.spec.js +0 -190
  79. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +0 -82
  80. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.spec.js +0 -342
  81. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +0 -69
  82. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +0 -54
  83. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.spec.js +0 -188
  84. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +0 -80
  85. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.spec.js +0 -338
  86. package/lib/types/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.d.ts +0 -1
  87. package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.d.ts +0 -1
  88. package/lib/types/components/loadingpanestateful/interfaces/IStartChatErrorPaneControlProps.d.ts +0 -4
  89. package/lib/types/components/loadingpanestateful/interfaces/IStartChatErrorPaneProps.d.ts +0 -4
  90. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.spec.d.ts +0 -1
  91. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.d.ts +0 -1
  92. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.spec.d.ts +0 -1
  93. /package/lib/cjs/components/{loadingpanestateful/interfaces/IStartChatErrorPaneControlProps.js → startchaterrorpanestateful/interfaces/IStartChatErrorPaneClassNames.js} +0 -0
  94. /package/lib/cjs/components/{loadingpanestateful/interfaces/IStartChatErrorPaneProps.js → startchaterrorpanestateful/interfaces/IStartChatErrorPaneComponentOverrides.js} +0 -0
  95. /package/lib/esm/components/{loadingpanestateful/interfaces/IStartChatErrorPaneControlProps.js → startchaterrorpanestateful/interfaces/IStartChatErrorPaneClassNames.js} +0 -0
  96. /package/lib/esm/components/{loadingpanestateful/interfaces/IStartChatErrorPaneProps.js → startchaterrorpanestateful/interfaces/IStartChatErrorPaneComponentOverrides.js} +0 -0
@@ -1,80 +0,0 @@
1
- import "@testing-library/jest-dom/extend-expect";
2
- import { createCardActionMiddleware } from "./cardActionMiddleware";
3
- describe("cardActionMiddleware test", () => {
4
- it("createCardActionMiddleware() with undefined botMagicCodeConfig should not change the sign in card url", () => {
5
- const next = args => args; // eslint-disable-line @typescript-eslint/no-explicit-any
6
- const signInUrl = "https://token.botframework.com/api/oauth/signin?signin=[signin]";
7
- const args = {
8
- cardAction: {
9
- type: "signin",
10
- value: signInUrl
11
- }
12
- };
13
- const results = createCardActionMiddleware(undefined)()(next)(args);
14
- expect(signInUrl).toEqual(results.cardAction.value);
15
- });
16
- it("createCardActionMiddleware() with botMagicCode enabled should not change the sign in card url", () => {
17
- const botMagicCodeConfig = {
18
- disabled: false
19
- };
20
- const next = args => args; // eslint-disable-line @typescript-eslint/no-explicit-any
21
- const signInUrl = "https://token.botframework.com/api/oauth/signin?signin=[signin]";
22
- const args = {
23
- cardAction: {
24
- type: "signin",
25
- value: signInUrl
26
- }
27
- };
28
- const results = createCardActionMiddleware(botMagicCodeConfig)()(next)(args);
29
- expect(args.cardAction.value).toEqual(results.cardAction.value);
30
- });
31
- it("createCardActionMiddleware() with botMagicCode disabled & no fwdUrl should not change the sign in card url", () => {
32
- const botMagicCodeConfig = {
33
- disabled: true
34
- };
35
- const next = args => args; // eslint-disable-line @typescript-eslint/no-explicit-any
36
- const signInUrl = "https://token.botframework.com/api/oauth/signin?signin=[signin]";
37
- const args = {
38
- cardAction: {
39
- type: "signin",
40
- value: signInUrl
41
- }
42
- };
43
- const results = createCardActionMiddleware(botMagicCodeConfig)()(next)(args);
44
- expect(args.cardAction.value).toEqual(results.cardAction.value);
45
- });
46
- it("createCardActionMiddleware() with botMagicCode disabled & fwdUrl should append the fwdUrl in the sign in card url", () => {
47
- const botMagicCodeConfig = {
48
- disabled: true,
49
- fwdUrl: "http://localhost/forwarder.html"
50
- };
51
- const next = args => args; // eslint-disable-line @typescript-eslint/no-explicit-any
52
- const signInUrl = "https://token.botframework.com/api/oauth/signin?signin=[signin]";
53
- const args = {
54
- cardAction: {
55
- type: "signin",
56
- value: signInUrl
57
- }
58
- };
59
- const results = createCardActionMiddleware(botMagicCodeConfig)()(next)(args);
60
- expect(signInUrl === results.cardAction.value).toBe(false);
61
- expect(results.cardAction.value === `${signInUrl}&fwdUrl=${botMagicCodeConfig.fwdUrl}`).toBe(true);
62
- });
63
- it("createCardActionMiddleware() should not append fwdUrl if fwdUrl & sign in card url are not in the same domain", () => {
64
- const botMagicCodeConfig = {
65
- disabled: true,
66
- fwdUrl: "https://localhost/forwarder.html"
67
- };
68
- const next = args => args; // eslint-disable-line @typescript-eslint/no-explicit-any
69
- const signInUrl = "https://token.botframework.com/api/oauth/signin?signin=[signin]";
70
- const args = {
71
- cardAction: {
72
- type: "signin",
73
- value: signInUrl
74
- }
75
- };
76
- const results = createCardActionMiddleware(botMagicCodeConfig)()(next)(args);
77
- expect(signInUrl === results.cardAction.value).toBe(true);
78
- expect(results.cardAction.value === `${signInUrl}&fwdUrl=${botMagicCodeConfig.fwdUrl}`).toBe(false);
79
- });
80
- });
@@ -1,338 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import { Constants } from "../../../../../common/Constants";
3
- import { WebChatActionType } from "../../enums/WebChatActionType";
4
- import createMessageSequenceIdOverrideMiddleware from "./messageSequenceIdOverrideMiddleware";
5
- describe("messageSequenceIdOverrideMiddleware", () => {
6
- it("sequenceId is overrided", () => {
7
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
8
- const next = args => args;
9
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
- const dispatch = () => {
11
- return 1;
12
- };
13
- const action = {
14
- type: WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY,
15
- payload: {
16
- text: "test-text",
17
- activity: {
18
- channelId: "ACS_CHANNEL",
19
- from: {
20
- role: "user"
21
- },
22
- channelData: {
23
- metadata: {
24
- "OriginalMessageId": "1683742135918"
25
- },
26
- "webchat:sequence-id": 12345
27
- }
28
- }
29
- }
30
- };
31
- const middleware = createMessageSequenceIdOverrideMiddleware(dispatch)(next)(action);
32
- let resultValue;
33
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
34
- const channelData = middleware.payload.activity.channelData;
35
- Object.keys(channelData).forEach(function (key) {
36
- if (key === Constants.WebchatSequenceIdAttribute) {
37
- resultValue = channelData[key];
38
- }
39
- });
40
- expect(resultValue).toEqual(1683742135918);
41
- });
42
- it("sequenceId is not overrided due to empty string for originalID", () => {
43
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
44
- const next = args => args;
45
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
46
- const dispatch = () => {
47
- return 1;
48
- };
49
- const action = {
50
- type: WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY,
51
- payload: {
52
- text: "test-text",
53
- activity: {
54
- channelId: "ACS_CHANNEL",
55
- from: {
56
- role: "user"
57
- },
58
- channelData: {
59
- metadata: {
60
- "OriginalMessageId": ""
61
- },
62
- "webchat:sequence-id": 12345
63
- }
64
- }
65
- }
66
- };
67
- const middleware = createMessageSequenceIdOverrideMiddleware(dispatch)(next)(action);
68
- let resultValue;
69
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
70
- const channelData = middleware.payload.activity.channelData;
71
- Object.keys(channelData).forEach(function (key) {
72
- if (key === Constants.WebchatSequenceIdAttribute) {
73
- resultValue = channelData[key];
74
- }
75
- });
76
- expect(resultValue).toEqual(12345);
77
- });
78
- it("sequenceId is not overrided, due to OriginalMessageId being not a string of numbers ", () => {
79
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
80
- const next = args => args;
81
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
82
- const dispatch = () => {
83
- return 1;
84
- };
85
- const action = {
86
- type: WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY,
87
- payload: {
88
- text: "test-text",
89
- activity: {
90
- channelId: "ACS_CHANNEL",
91
- from: {
92
- role: "user"
93
- },
94
- channelData: {
95
- metadata: {
96
- "OriginalMessageId": "abcdf"
97
- },
98
- "webchat:sequence-id": 12345
99
- }
100
- }
101
- }
102
- };
103
- const middleware = createMessageSequenceIdOverrideMiddleware(dispatch)(next)(action);
104
- let resultValue;
105
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
106
- const channelData = middleware.payload.activity.channelData;
107
- Object.keys(channelData).forEach(function (key) {
108
- if (key === Constants.WebchatSequenceIdAttribute) {
109
- resultValue = channelData[key];
110
- }
111
- });
112
- expect(resultValue).toEqual(12345);
113
- });
114
- it("no changes since webchat id is not present", () => {
115
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
116
- const next = args => args;
117
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
118
- const dispatch = () => {
119
- return 1;
120
- };
121
- const payloadExpected = {
122
- payload: {
123
- text: "test-text",
124
- activity: {
125
- channelId: "ACS_CHANNEL",
126
- from: {
127
- role: "user"
128
- },
129
- channelData: {
130
- metadata: {
131
- "OriginalMessageId": "123456789"
132
- }
133
- }
134
- }
135
- }
136
- };
137
- const action = {
138
- type: WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY,
139
- payload: {
140
- text: "test-text",
141
- activity: {
142
- channelId: "ACS_CHANNEL",
143
- from: {
144
- role: "user"
145
- },
146
- channelData: {
147
- metadata: {
148
- "OriginalMessageId": "123456789"
149
- }
150
- }
151
- }
152
- }
153
- };
154
- const middleware = createMessageSequenceIdOverrideMiddleware(dispatch)(next)(action);
155
- expect(middleware.payload).toEqual(payloadExpected.payload);
156
- });
157
- it("no changes since OriginalMessageId is not present", () => {
158
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
159
- const next = args => args;
160
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
161
- const dispatch = () => {
162
- return 1;
163
- };
164
- const payloadExpected = {
165
- payload: {
166
- text: "test-text",
167
- activity: {
168
- channelId: "ACS_CHANNEL",
169
- from: {
170
- role: "user"
171
- },
172
- channelData: {
173
- metadata: {},
174
- "webchat:sequence-id": 12345
175
- }
176
- }
177
- }
178
- };
179
- const action = {
180
- type: WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY,
181
- payload: {
182
- text: "test-text",
183
- activity: {
184
- channelId: "ACS_CHANNEL",
185
- from: {
186
- role: "user"
187
- },
188
- channelData: {
189
- metadata: {},
190
- "webchat:sequence-id": 12345
191
- }
192
- }
193
- }
194
- };
195
- const middleware = createMessageSequenceIdOverrideMiddleware(dispatch)(next)(action);
196
- expect(middleware.payload).toEqual(payloadExpected.payload);
197
- });
198
- it("no override, since the type of message is not incoming activity", () => {
199
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
200
- const next = args => args;
201
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
202
- const dispatch = () => {
203
- return 1;
204
- };
205
- const action = {
206
- type: "something else",
207
- payload: {
208
- text: "test-text",
209
- activity: {
210
- channelId: "ACS_CHANNEL",
211
- from: {
212
- role: "user"
213
- },
214
- channelData: {
215
- metadata: {
216
- "OriginalMessageId": "1683742135918"
217
- },
218
- "webchat:sequence-id": 12345
219
- }
220
- }
221
- }
222
- };
223
- const middleware = createMessageSequenceIdOverrideMiddleware(dispatch)(next)(action);
224
- let resultValue;
225
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
226
- const channelData = middleware.payload.activity.channelData;
227
- Object.keys(channelData).forEach(function (key) {
228
- if (key === Constants.WebchatSequenceIdAttribute) {
229
- resultValue = channelData[key];
230
- }
231
- });
232
- expect(resultValue).toEqual(12345);
233
- });
234
- it("no override, since the channel is not ACS", () => {
235
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
236
- const next = args => args;
237
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
238
- const dispatch = () => {
239
- return 1;
240
- };
241
- const action = {
242
- type: WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY,
243
- payload: {
244
- text: "test-text",
245
- activity: {
246
- channelId: "something_else",
247
- from: {
248
- role: "user"
249
- },
250
- channelData: {
251
- metadata: {
252
- "OriginalMessageId": "1683742135918"
253
- },
254
- "webchat:sequence-id": 12345
255
- }
256
- }
257
- }
258
- };
259
- const middleware = createMessageSequenceIdOverrideMiddleware(dispatch)(next)(action);
260
- let resultValue;
261
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
262
- const channelData = middleware.payload.activity.channelData;
263
- Object.keys(channelData).forEach(function (key) {
264
- if (key === Constants.WebchatSequenceIdAttribute) {
265
- resultValue = channelData[key];
266
- }
267
- });
268
- expect(resultValue).toEqual(12345);
269
- });
270
- it("no override, since the channel channelData is not present", () => {
271
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
272
- const next = args => args;
273
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
274
- const dispatch = () => {
275
- return 1;
276
- };
277
- const action = {
278
- type: WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY,
279
- payload: {
280
- text: "test-text channel data is not present",
281
- activity: {
282
- channelId: "ACS_CHANNEL",
283
- from: {
284
- role: "user"
285
- }
286
- }
287
- }
288
- };
289
- const middleware = createMessageSequenceIdOverrideMiddleware(dispatch)(next)(action);
290
- expect(middleware.payload).toEqual(action.payload);
291
- });
292
- it("no override, since channelData is empty object", () => {
293
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
294
- const next = args => args;
295
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
296
- const dispatch = () => {
297
- return 1;
298
- };
299
- const action = {
300
- type: WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY,
301
- payload: {
302
- text: "test-text channel data empty",
303
- activity: {
304
- channelId: "ACS_CHANNEL",
305
- from: {
306
- role: "user"
307
- },
308
- channelData: {}
309
- }
310
- }
311
- };
312
- const middleware = createMessageSequenceIdOverrideMiddleware(dispatch)(next)(action);
313
- expect(middleware.payload).toEqual(action.payload);
314
- });
315
- it("no override, since channelData null", () => {
316
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
317
- const next = args => args;
318
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
319
- const dispatch = () => {
320
- return 1;
321
- };
322
- const action = {
323
- type: WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY,
324
- payload: {
325
- text: "test-channel Data null",
326
- activity: {
327
- channelId: "ACS_CHANNEL",
328
- from: {
329
- role: "user"
330
- },
331
- channelData: null
332
- }
333
- }
334
- };
335
- const middleware = createMessageSequenceIdOverrideMiddleware(dispatch)(next)(action);
336
- expect(middleware.payload).toEqual(action.payload);
337
- });
338
- });
@@ -1,4 +0,0 @@
1
- export interface IStartChatErrorPaneControlProps {
2
- titleText?: string;
3
- subtitleText?: string;
4
- }
@@ -1,4 +0,0 @@
1
- import { IStartChatErrorPaneControlProps } from "./IStartChatErrorPaneControlProps";
2
- export interface IStartChatErrorPaneProps {
3
- controlProps?: IStartChatErrorPaneControlProps;
4
- }