diff --git a/apps/teams-test-app/e2e-test-data/externalAppCardActionsForCEA.json b/apps/teams-test-app/e2e-test-data/externalAppCardActionsForCEA.json new file mode 100644 index 0000000000..ff31dced5a --- /dev/null +++ b/apps/teams-test-app/e2e-test-data/externalAppCardActionsForCEA.json @@ -0,0 +1,13 @@ +{ + "name": "ExternalAppCardActionsForCEA", + "version": ">2.18.0", + "platform": "Web", + "testCases": [ + { + "title": "checkExternalAppCardActionsForCEACapability API Call - Success", + "type": "callResponse", + "boxSelector": "#box_checkExternalAppCardActionsForCEACapability", + "expectedTestAppValue": "External App Card Actions For CEA module is supported" + } + ] +} diff --git a/apps/teams-test-app/src/components/privateApis/ExternalAppCardActionsForCEAAPIs.tsx b/apps/teams-test-app/src/components/privateApis/ExternalAppCardActionsForCEAAPIs.tsx index 282fc84f7f..ca03aa1d84 100644 --- a/apps/teams-test-app/src/components/privateApis/ExternalAppCardActionsForCEAAPIs.tsx +++ b/apps/teams-test-app/src/components/privateApis/ExternalAppCardActionsForCEAAPIs.tsx @@ -14,7 +14,7 @@ const CheckExternalAppCardActionsForCEACapability = (): React.ReactElement => } supported`, }); -const CECProcessActionSubmit = (): React.ReactElement => +const ProcessActionSubmitForCEA = (): React.ReactElement => ApiWithTextInput<{ appId: AppId; conversationId: string; @@ -27,6 +27,9 @@ const CECProcessActionSubmit = (): React.ReactElement => if (!input.appId) { throw new Error('appId is required'); } + if (!input.conversationId) { + throw new Error('conversationId is required'); + } if (!input.actionSubmitPayload) { throw new Error('actionSubmitPayload is required'); } @@ -41,7 +44,8 @@ const CECProcessActionSubmit = (): React.ReactElement => }, }, defaultInput: JSON.stringify({ - appId: 'b7f8c0a0-6c1d-4a9a-9c0a-2c3f1c0a3b0a', + appId: new AppId('b7f8c0a0-6c1d-4a9a-9c0a-2c3f1c0a3b0a'), + conversationId: 'conversationId', actionSubmitPayload: { id: 'submitId', data: 'data1', @@ -49,11 +53,11 @@ const CECProcessActionSubmit = (): React.ReactElement => }), }); -const CECProcessActionOpenUrl = (): React.ReactElement => +const ProcessActionOpenUrlForCEA = (): React.ReactElement => ApiWithTextInput<{ appId: AppId; conversationId: string; - url: string; + url: URL; }>({ name: 'processActionOpenUrlForCEA', title: 'Process Action Open Url For CEA', @@ -62,6 +66,9 @@ const CECProcessActionOpenUrl = (): React.ReactElement => if (!input.appId) { throw new Error('appId is required'); } + if (!input.conversationId) { + throw new Error('conversationId is required'); + } if (!input.url) { throw new Error('url is required'); } @@ -70,22 +77,23 @@ const CECProcessActionOpenUrl = (): React.ReactElement => const result = await externalAppCardActionsForCEA.processActionOpenUrl( input.appId, input.conversationId, - new URL(input.url), + input.url, ); return JSON.stringify(result); }, }, defaultInput: JSON.stringify({ - appId: 'b7f8c0a0-6c1d-4a9a-9c0a-2c3f1c0a3b0a', - url: 'https://www.example.com', + appId: new AppId('b7f8c0a0-6c1d-4a9a-9c0a-2c3f1c0a3b0a'), + conversationId: 'conversationID', + url: new URL('https://www.example.com'), }), }); const ExternalAppCardActionsForCEAAPIs = (): React.ReactElement => ( - - + + ); diff --git a/packages/teams-js/src/private/externalAppCardActionsForCEA.ts b/packages/teams-js/src/private/externalAppCardActionsForCEA.ts index eea0d73ce8..8acab11045 100644 --- a/packages/teams-js/src/private/externalAppCardActionsForCEA.ts +++ b/packages/teams-js/src/private/externalAppCardActionsForCEA.ts @@ -47,7 +47,7 @@ export namespace externalAppCardActionsForCEA { ApiName.ExternalAppCardActionsForCEA_ProcessActionOpenUrl, ), ApiName.ExternalAppCardActionsForCEA_ProcessActionOpenUrl, - [appId, url.href, conversationId], + [appId, conversationId, url], ); if (error) { throw error;