diff --git a/generators/generator-bot-adaptive/package.json b/generators/generator-bot-adaptive/package.json index 98ca42a60a..e54a99a1a4 100644 --- a/generators/generator-bot-adaptive/package.json +++ b/generators/generator-bot-adaptive/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/generator-bot-adaptive", - "version": "1.0.0", + "version": "1.0.1", "description": "Yeoman generator for creating a base bot built on the Azure Bot Framework and the Adaptive stack.", "keywords": [ "microsoft", diff --git a/generators/generator-bot-core-assistant/package.json b/generators/generator-bot-core-assistant/package.json index 22944a9a4b..402d2d32cf 100644 --- a/generators/generator-bot-core-assistant/package.json +++ b/generators/generator-bot-core-assistant/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/generator-bot-core-assistant", - "version": "1.0.0", + "version": "1.0.1", "description": "Yeoman generator for creating an assistant-style bot with NLP built on the Azure Bot Framework.", "keywords": [ "microsoft", @@ -24,7 +24,7 @@ "lint": "eslint -c ../../.eslintrc.json ." }, "dependencies": { - "@microsoft/generator-bot-adaptive": "workspace:^1.0.0", + "@microsoft/generator-bot-adaptive": "workspace:^1.0.1", "yeoman-generator": "^2.0.5", "yeoman-test": "^1.9.1" }, diff --git a/generators/generator-bot-core-language/package.json b/generators/generator-bot-core-language/package.json index 5cecb71f13..e287f5c924 100644 --- a/generators/generator-bot-core-language/package.json +++ b/generators/generator-bot-core-language/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/generator-bot-core-language", - "version": "1.0.0", + "version": "1.0.1", "description": "Yeoman generator for creating a simple conversational bot with NLP built on the Azure Bot Framework.", "keywords": [ "microsoft", @@ -26,7 +26,7 @@ "lint": "eslint -c ../../.eslintrc.json ." }, "dependencies": { - "@microsoft/generator-bot-adaptive": "workspace:^1.0.0", + "@microsoft/generator-bot-adaptive": "workspace:^1.0.1", "yeoman-generator": "^2.0.5", "yeoman-test": "^1.9.1" }, diff --git a/generators/generator-bot-core-qna/package.json b/generators/generator-bot-core-qna/package.json index 9692356e3e..54910cd565 100644 --- a/generators/generator-bot-core-qna/package.json +++ b/generators/generator-bot-core-qna/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/generator-bot-core-qna", - "version": "1.0.0", + "version": "1.0.1", "description": "Yeoman generator for creating a bot and connecting to a QnA Maker knowledge base.", "keywords": [ "microsoft", @@ -23,7 +23,7 @@ "lint": "eslint -c ../../.eslintrc.json ." }, "dependencies": { - "@microsoft/generator-bot-adaptive": "workspace:^1.0.0", + "@microsoft/generator-bot-adaptive": "workspace:^1.0.1", "yeoman-generator": "^2.0.5", "yeoman-test": "^1.9.1" }, diff --git a/generators/generator-bot-empty/package.json b/generators/generator-bot-empty/package.json index a4cdb7f0ff..f74df78607 100644 --- a/generators/generator-bot-empty/package.json +++ b/generators/generator-bot-empty/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/generator-bot-empty", - "version": "1.0.0", + "version": "1.0.1", "description": "Yeoman generator for creating an empty bot built on the Azure Bot Framework.", "keywords": [ "microsoft", @@ -26,7 +26,7 @@ "lint": "eslint -c ../../.eslintrc.json ." }, "dependencies": { - "@microsoft/generator-bot-adaptive": "workspace:^1.0.0", + "@microsoft/generator-bot-adaptive": "workspace:^1.0.1", "yeoman-generator": "^2.0.5", "yeoman-test": "^1.9.1" }, diff --git a/generators/generator-bot-enterprise-assistant/generators/app/index.js b/generators/generator-bot-enterprise-assistant/generators/app/index.js index 33ed5d2b6f..c2f41293e8 100644 --- a/generators/generator-bot-enterprise-assistant/generators/app/index.js +++ b/generators/generator-bot-enterprise-assistant/generators/app/index.js @@ -36,7 +36,7 @@ module.exports = class extends BaseGenerator { { isPlugin: true, name: 'Microsoft.Bot.Builder.AI.Orchestrator', - version: '4.13.2', + version: '4.14.0-rc0', }, ], modifyApplicationSettings: (appSettings) => { diff --git a/generators/generator-bot-enterprise-assistant/package.json b/generators/generator-bot-enterprise-assistant/package.json index c7f51f4dc0..2a839848f3 100644 --- a/generators/generator-bot-enterprise-assistant/package.json +++ b/generators/generator-bot-enterprise-assistant/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/generator-bot-enterprise-assistant", - "version": "1.0.0", + "version": "1.0.1", "description": "Yeoman generator for creating an enterprise assistant, with a root bot and two skills built on the Azure Bot Framework.", "keywords": [ "microsoft", @@ -25,9 +25,9 @@ "lint": "eslint -c ../../.eslintrc.json ." }, "dependencies": { - "@microsoft/generator-bot-adaptive": "workspace:^1.0.0", - "@microsoft/generator-bot-enterprise-calendar": "workspace:^1.0.0", - "@microsoft/generator-bot-enterprise-people": "workspace:^1.0.0", + "@microsoft/generator-bot-adaptive": "workspace:^1.0.1", + "@microsoft/generator-bot-enterprise-calendar": "workspace:^1.0.1", + "@microsoft/generator-bot-enterprise-people": "workspace:^1.0.1", "uuid": "^8.3.2", "yeoman-generator": "^2.0.5", "yeoman-test": "^1.9.1" diff --git a/generators/generator-bot-enterprise-calendar/package.json b/generators/generator-bot-enterprise-calendar/package.json index 419f85cefa..a14cafd7fb 100644 --- a/generators/generator-bot-enterprise-calendar/package.json +++ b/generators/generator-bot-enterprise-calendar/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/generator-bot-enterprise-calendar", - "version": "1.0.0", + "version": "1.0.1", "description": "Yeoman generator for creating an Adaptive bot built on the Azure Bot Framework using the Calendar template.", "keywords": [ "microsoft", @@ -24,7 +24,7 @@ "lint": "eslint ." }, "dependencies": { - "@microsoft/generator-bot-adaptive": "workspace:^1.0.0", + "@microsoft/generator-bot-adaptive": "workspace:^1.0.1", "yeoman-generator": "^2.0.5", "yeoman-test": "^1.9.1" }, diff --git a/generators/generator-bot-enterprise-people/package.json b/generators/generator-bot-enterprise-people/package.json index 7e8b5bb1f8..c18414182d 100644 --- a/generators/generator-bot-enterprise-people/package.json +++ b/generators/generator-bot-enterprise-people/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft/generator-bot-enterprise-people", - "version": "1.0.0", + "version": "1.0.1", "description": "Yeoman generator for creating an Adaptive bot built on the Azure Bot Framework using the People template.", "keywords": [ "microsoft", @@ -24,7 +24,7 @@ "lint": "eslint -c ../../.eslintrc.json ." }, "dependencies": { - "@microsoft/generator-bot-adaptive": "workspace:^1.0.0", + "@microsoft/generator-bot-adaptive": "workspace:^1.0.1", "yeoman-generator": "^2.0.5", "yeoman-test": "^1.9.1" }, diff --git a/packages/AdaptiveCards/Actions/UpdateAdaptiveCard.cs b/packages/AdaptiveCards/Actions/UpdateAdaptiveCard.cs index e70c3c9980..ac0a8a8b56 100644 --- a/packages/AdaptiveCards/Actions/UpdateAdaptiveCard.cs +++ b/packages/AdaptiveCards/Actions/UpdateAdaptiveCard.cs @@ -34,6 +34,7 @@ protected async override Task OnProcessCardAsync(DialogContext dc, JObje } // Update existing activity + activity.Id = activityId; await dc.Context.UpdateActivityAsync(activity, cancellationToken).ConfigureAwait(false); } else diff --git a/packages/AdaptiveCards/Microsoft.Bot.Components.AdaptiveCards.csproj b/packages/AdaptiveCards/Microsoft.Bot.Components.AdaptiveCards.csproj index ebcd529718..e8ebc4a568 100644 --- a/packages/AdaptiveCards/Microsoft.Bot.Components.AdaptiveCards.csproj +++ b/packages/AdaptiveCards/Microsoft.Bot.Components.AdaptiveCards.csproj @@ -20,7 +20,7 @@ - + diff --git a/packages/AdaptiveCards/Schemas/Microsoft.Bot.Components.UpdateAdaptiveCard.schema b/packages/AdaptiveCards/Schemas/Microsoft.Bot.Components.UpdateAdaptiveCard.schema index b51cb2b73e..2f2cde9e64 100644 --- a/packages/AdaptiveCards/Schemas/Microsoft.Bot.Components.UpdateAdaptiveCard.schema +++ b/packages/AdaptiveCards/Schemas/Microsoft.Bot.Components.UpdateAdaptiveCard.schema @@ -40,7 +40,7 @@ "$ref": "schema:#/definitions/stringExpression", "title": "Activity ID", "description": "ID of the cards activity to update. Required unless sending a response to an invoked Action.Execute.", - "default": "=turn.activity.replyTo" + "default": "=turn.activity.replyToId" } }, "required": [ "template", "data" ] diff --git a/packages/Graph/Microsoft.Bot.Components.Graph.csproj b/packages/Graph/Microsoft.Bot.Components.Graph.csproj index 7e09985822..c6591a5543 100644 --- a/packages/Graph/Microsoft.Bot.Components.Graph.csproj +++ b/packages/Graph/Microsoft.Bot.Components.Graph.csproj @@ -20,7 +20,7 @@ - + all diff --git a/packages/HelpAndCancel/Microsoft.Bot.Components.HelpAndCancel.nuspec b/packages/HelpAndCancel/Microsoft.Bot.Components.HelpAndCancel.nuspec index dd564f2118..d7fffab27f 100644 --- a/packages/HelpAndCancel/Microsoft.Bot.Components.HelpAndCancel.nuspec +++ b/packages/HelpAndCancel/Microsoft.Bot.Components.HelpAndCancel.nuspec @@ -13,7 +13,7 @@ Contains Adaptive Dialog assets to support Help and Cancel conversational flows in a bot built on the Azure Bot Framework. msbot-component msbot-content conversationalcore helpintent cancelintent preview - + diff --git a/packages/Teams/dotnet/Actions/SendMessageToTeamsChannel.cs b/packages/Teams/dotnet/Actions/SendMessageToTeamsChannel.cs index 912b8beecf..5aa027bba1 100644 --- a/packages/Teams/dotnet/Actions/SendMessageToTeamsChannel.cs +++ b/packages/Teams/dotnet/Actions/SendMessageToTeamsChannel.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; +using System.Security.Claims; using System.Threading; using System.Threading.Tasks; using AdaptiveExpressions.Properties; @@ -118,22 +119,19 @@ public SendMessageToTeamsChannel([CallerFilePath] string callerPath = "", [Calle teamsChannelId = dc.Context.Activity.TeamsGetChannelId(); } - if (!(dc.Context.Adapter is BotFrameworkAdapter)) + // Retrieve the bot appid from TurnState's ClaimsIdentity + string appId; + if (dc.Context.TurnState.Get(BotAdapter.BotIdentityKey) is ClaimsIdentity botIdentity) { - throw new InvalidOperationException($"{Kind} is not supported by the current adapter."); + appId = JwtTokenValidation.GetAppIdFromClaims(botIdentity.Claims); } - - // TODO: this will NOT work with certificate app credentials - - // TeamsInfo.SendMessageToTeamsChannelAsync requires AppCredentials - var credentials = dc.Context.TurnState.Get()?.Credentials as MicrosoftAppCredentials; - if (credentials == null) + else { - throw new InvalidOperationException($"Missing credentials as {nameof(MicrosoftAppCredentials)} in {nameof(IConnectorClient)} from TurnState"); + throw new InvalidOperationException($"Missing {BotAdapter.BotIdentityKey} in {nameof(ITurnContext)} TurnState"); } // The result comes back as a tuple, which is used to set the two properties (if present). - var result = await TeamsInfo.SendMessageToTeamsChannelAsync(dc.Context, activity, teamsChannelId, credentials, cancellationToken: cancellationToken).ConfigureAwait(false); + var result = await TeamsInfo.SendMessageToTeamsChannelAsync(dc.Context, activity, teamsChannelId, appId, cancellationToken: cancellationToken).ConfigureAwait(false); if (ConversationReferenceProperty != null) { diff --git a/packages/Teams/dotnet/Microsoft.Bot.Components.Teams.csproj b/packages/Teams/dotnet/Microsoft.Bot.Components.Teams.csproj index d333f2f004..f4a42a23a5 100644 --- a/packages/Teams/dotnet/Microsoft.Bot.Components.Teams.csproj +++ b/packages/Teams/dotnet/Microsoft.Bot.Components.Teams.csproj @@ -35,7 +35,7 @@ - + diff --git a/packages/Teams/js/package.json b/packages/Teams/js/package.json index 3dafdda466..c2944bb59f 100644 --- a/packages/Teams/js/package.json +++ b/packages/Teams/js/package.json @@ -29,13 +29,13 @@ "main": "lib/index.js", "types": "lib/index.d.ts", "peerDependencies": { - "adaptive-expressions": "~4.13.4", - "botbuilder": "~4.13.4", - "botbuilder-dialogs": "~4.13.4", - "botbuilder-dialogs-adaptive": "~4.13.4-preview", - "botbuilder-dialogs-adaptive-runtime-core": "~4.13.4-preview", - "botbuilder-dialogs-declarative": "~4.13.4-preview", - "botbuilder-stdlib": "~4.13.4-internal", + "adaptive-expressions": "~4.14.0-rc0", + "botbuilder": "~4.14.0-rc0", + "botbuilder-dialogs": "~4.14.0-rc0", + "botbuilder-dialogs-adaptive": "~4.14.0-preview.rc0", + "botbuilder-dialogs-adaptive-runtime-core": "~4.14.0-preview.rc0", + "botbuilder-dialogs-declarative": "~4.14.0-preview.rc0", + "botbuilder-stdlib": "~4.14.0-internal.rc0", "lodash": "^4.17.21" }, "devDependencies": { @@ -43,13 +43,13 @@ "@types/lodash": "^4.14.168", "@typescript-eslint/eslint-plugin": "latest", "@typescript-eslint/parser": "latest", - "adaptive-expressions": "4.13.4", - "botbuilder": "4.13.4", - "botbuilder-dialogs": "4.13.4", - "botbuilder-dialogs-adaptive": "4.13.4-preview", - "botbuilder-dialogs-adaptive-runtime-core": "4.13.4-preview", - "botbuilder-dialogs-declarative": "4.13.4-preview", - "botbuilder-stdlib": "4.13.4-internal", + "adaptive-expressions": "4.14.0-rc0", + "botbuilder": "4.14.0-rc0", + "botbuilder-dialogs": "4.14.0-rc0", + "botbuilder-dialogs-adaptive": "~4.14.0-preview.rc0", + "botbuilder-dialogs-adaptive-runtime-core": "~4.14.0-preview.rc0", + "botbuilder-dialogs-declarative": "~4.14.0-preview.rc0", + "botbuilder-stdlib": "~4.14.0-internal.rc0", "eslint": "latest", "lodash": "^4.17.21", "rimraf": "^3.0.2", diff --git a/packages/Welcome/Microsoft.Bot.Components.Welcome.nuspec b/packages/Welcome/Microsoft.Bot.Components.Welcome.nuspec index 43d5a1026d..26c0ee99a9 100644 --- a/packages/Welcome/Microsoft.Bot.Components.Welcome.nuspec +++ b/packages/Welcome/Microsoft.Bot.Components.Welcome.nuspec @@ -13,7 +13,7 @@ An Adaptive Dialog for greeting new and returning users on first interaction with your bot built on the Azure Bot Framework. msbot-component msbot-content conversationalcore welcome preview - + diff --git a/skills/csharp/calendarskill/CalendarSkill.csproj b/skills/csharp/calendarskill/CalendarSkill.csproj index 58f7186653..97581c211b 100644 --- a/skills/csharp/calendarskill/CalendarSkill.csproj +++ b/skills/csharp/calendarskill/CalendarSkill.csproj @@ -14,7 +14,7 @@ - + diff --git a/skills/declarative/Calendar/Calendar/Calendar.csproj b/skills/declarative/Calendar/Calendar/Calendar.csproj index 7fe5d77eb9..4ed93111c6 100644 --- a/skills/declarative/Calendar/Calendar/Calendar.csproj +++ b/skills/declarative/Calendar/Calendar/Calendar.csproj @@ -12,7 +12,7 @@ - + diff --git a/skills/declarative/People/People/People.csproj b/skills/declarative/People/People/People.csproj index 9b4d6229b0..d1bfdc62b8 100644 --- a/skills/declarative/People/People/People.csproj +++ b/skills/declarative/People/People/People.csproj @@ -12,9 +12,9 @@ - - - - + + + + \ No newline at end of file diff --git a/tests/functional/Bots/JavaScript/Consumers/CodeFirst/SimpleHostBot/package.json b/tests/functional/Bots/JavaScript/Consumers/CodeFirst/SimpleHostBot/package.json index bddc987858..a36b9f459d 100644 --- a/tests/functional/Bots/JavaScript/Consumers/CodeFirst/SimpleHostBot/package.json +++ b/tests/functional/Bots/JavaScript/Consumers/CodeFirst/SimpleHostBot/package.json @@ -15,8 +15,8 @@ "url": "https://github.com" }, "dependencies": { - "botbuilder": "~4.13.3", - "botbuilder-dialogs": "~4.13.3", + "botbuilder": "4.14.0-rc0", + "botbuilder-dialogs": "~4.14.0-rc0", "dotenv": "~8.2.0", "restify": "~8.5.1" }, diff --git a/tests/functional/Bots/JavaScript/Consumers/CodeFirst/WaterfallHostBot/package.json b/tests/functional/Bots/JavaScript/Consumers/CodeFirst/WaterfallHostBot/package.json index 197d3fb53a..378267472e 100644 --- a/tests/functional/Bots/JavaScript/Consumers/CodeFirst/WaterfallHostBot/package.json +++ b/tests/functional/Bots/JavaScript/Consumers/CodeFirst/WaterfallHostBot/package.json @@ -15,8 +15,8 @@ "url": "https://github.com" }, "dependencies": { - "botbuilder": "~4.13.3", - "botbuilder-dialogs": "~4.13.3", + "botbuilder": "~4.14.0-rc0", + "botbuilder-dialogs": "~4.14.0-rc0", "dotenv": "~8.2.0", "restify": "~8.5.1" }, diff --git a/tests/functional/Bots/JavaScript/Skills/CodeFirst/EchoSkillBot/package.json b/tests/functional/Bots/JavaScript/Skills/CodeFirst/EchoSkillBot/package.json index ff06ea8e8e..507be68816 100644 --- a/tests/functional/Bots/JavaScript/Skills/CodeFirst/EchoSkillBot/package.json +++ b/tests/functional/Bots/JavaScript/Skills/CodeFirst/EchoSkillBot/package.json @@ -15,7 +15,7 @@ "url": "https://github.com" }, "dependencies": { - "botbuilder": "~4.13.3", + "botbuilder": "~4.14.0-rc0", "dotenv": "^8.2.0", "restify": "~8.5.1" }, diff --git a/tests/functional/Bots/JavaScript/Skills/CodeFirst/WaterfallSkillBot/package.json b/tests/functional/Bots/JavaScript/Skills/CodeFirst/WaterfallSkillBot/package.json index f7990840f7..678f147e71 100644 --- a/tests/functional/Bots/JavaScript/Skills/CodeFirst/WaterfallSkillBot/package.json +++ b/tests/functional/Bots/JavaScript/Skills/CodeFirst/WaterfallSkillBot/package.json @@ -15,8 +15,8 @@ "url": "https://github.com" }, "dependencies": { - "botbuilder": "~4.13.3", - "botbuilder-dialogs": "~4.13.3", + "botbuilder": "~4.14.0-rc0", + "botbuilder-dialogs": "~4.14.0-rc0", "dotenv": "^8.2.0", "node-fetch": "^2.6.1", "restify": "~8.5.1" diff --git a/tests/functional/Libraries/TranscriptConverter/TranscriptConverter.csproj b/tests/functional/Libraries/TranscriptConverter/TranscriptConverter.csproj index aa4817caff..dcf48b0d57 100644 --- a/tests/functional/Libraries/TranscriptConverter/TranscriptConverter.csproj +++ b/tests/functional/Libraries/TranscriptConverter/TranscriptConverter.csproj @@ -8,7 +8,7 @@ - + diff --git a/tests/functional/Libraries/TranscriptTestRunner/TranscriptTestRunner.csproj b/tests/functional/Libraries/TranscriptTestRunner/TranscriptTestRunner.csproj index 357cf4ee10..fc39ae40ac 100644 --- a/tests/functional/Libraries/TranscriptTestRunner/TranscriptTestRunner.csproj +++ b/tests/functional/Libraries/TranscriptTestRunner/TranscriptTestRunner.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/ActionTests.cs b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/ActionTests.cs new file mode 100644 index 0000000000..c4f5ff73f7 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/ActionTests.cs @@ -0,0 +1,592 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Bot.Builder; +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.Dialogs.Adaptive; +using Microsoft.Bot.Builder.Dialogs.Adaptive.Testing; +using Microsoft.Bot.Builder.Dialogs.Declarative; +using Microsoft.Bot.Builder.Dialogs.Declarative.Obsolete; +using Microsoft.Bot.Connector; +using Microsoft.Bot.Connector.Authentication; +using Microsoft.Bot.Schema; +using Microsoft.Bot.Schema.Teams; +using Newtonsoft.Json.Linq; +using Xunit; + +namespace Microsoft.Bot.Components.Teams.Tests +{ + [CollectionDefinition("Dialogs.Adaptive")] + public class ActionTests : IClassFixture + { + private readonly ResourceExplorerFixture _resourceExplorerFixture; + + public ActionTests(ResourceExplorerFixture resourceExplorerFixture) + { + ComponentRegistration.Add(new DeclarativeComponentRegistration()); + ComponentRegistration.Add(new DialogsComponentRegistration()); + ComponentRegistration.Add(new AdaptiveComponentRegistration()); + ComponentRegistration.Add(new LanguageGenerationComponentRegistration()); + ComponentRegistration.Add(new AdaptiveTestingComponentRegistration()); + ComponentRegistration.Add(new DeclarativeComponentRegistrationBridge()); + + _resourceExplorerFixture = resourceExplorerFixture.Initialize(nameof(ActionTests)); + } + + [Fact] + public async Task Action_GetMeetingParticipant() + { + var participantResult = GetParticipant().ToString(); + + var uriToContent = new Dictionary() + { + { "/v1/meetings/meeting-id-1/participants/participant-aad-id-1?tenantId=tenant-id-1", participantResult }, + { "/v1/meetings/customMeetingId/participants/customParticipantId?tenantId=customTenantId", participantResult } + }; + + var teamsMiddleware = GetTeamsMiddleware(uriToContent); + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, middleware: new[] { teamsMiddleware }); + } + + [Fact] + public async Task Action_GetMeetingParticipantError() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test); + } + + [Fact] + public async Task Action_GetMeetingParticipantErrorWithAdapter() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + [Fact] + public async Task Action_GetMember() + { + var participantResult = GetParticipant().ToString(); + var uriToContent = new Dictionary() + { + { "/v3/conversations/Action_GetMember/members/member-id", participantResult }, + { "/v3/conversations/Action_GetMember/members/customMemberId", participantResult } + }; + + var teamsMiddleware = GetTeamsMiddleware(uriToContent); + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, middleware: new[] { teamsMiddleware }); + } + + [Fact] + public async Task Action_GetMemberError() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test); + } + + [Fact] + public async Task Action_GetMemberErrorWithAdapter() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + [Fact] + public async Task Action_GetPagedMembers() + { + var threeMembers = GenerateTeamMembers(3); + threeMembers.ContinuationToken = "customToken"; + + var twoMembers = GenerateTeamMembers(2); + twoMembers.ContinuationToken = "token"; + + var uriToContent = new Dictionary() + { + { "/v3/conversations/Action_GetPagedMembers/pagedmembers", JObject.FromObject(threeMembers).ToString() }, + { "/v3/conversations/Action_GetPagedMembers/pagedmembers?pageSize=2&continuationToken=token", JObject.FromObject(twoMembers).ToString() } + }; + + var teamsMiddleware = GetTeamsMiddleware(uriToContent); + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, middleware: new[] { teamsMiddleware }); + } + + [Fact] + public async Task Action_GetPagedMembersError() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test); + } + + [Fact] + public async Task Action_GetPagedTeamMembers() + { + var threeMembers = GenerateTeamMembers(3); + threeMembers.ContinuationToken = "token"; + + var twoMembers = GenerateTeamMembers(2); + twoMembers.ContinuationToken = "token"; + + var uriToContent = new Dictionary() + { + { "/v3/conversations/team-id-1/pagedmembers", JObject.FromObject(threeMembers).ToString() }, + { "/v3/conversations/team-id-1/pagedmembers?pageSize=2&continuationToken=token", JObject.FromObject(twoMembers).ToString() } + }; + + var teamsMiddleware = GetTeamsMiddleware(uriToContent); + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, middleware: new[] { teamsMiddleware }); + } + + [Fact] + public async Task Action_GetPagedTeamMembersError() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test); + } + + [Fact] + public async Task Action_GetTeamChannels() + { + var conversations = JObject.FromObject(new ConversationList + { + Conversations = new List() + { + new ChannelInfo { Id = "19:ChannelIdgeneralChannelId@thread.skype", Name = "Testing0" }, + new ChannelInfo { Id = "19:somechannelId2e5ab3df9ae9b594bdb@thread.skype", Name = "Testing1" }, + new ChannelInfo { Id = "19:somechannelId388ade16aa4dd375e69@thread.skype", Name = "Testing2" }, + } + }).ToString(); + + var uriToContent = new Dictionary() + { + { "/v3/teams/team-id-1/conversations", conversations }, + { "/v3/teams/customTeamId/conversations", conversations } + }; + + var teamsMiddleware = GetTeamsMiddleware(uriToContent); + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, middleware: new[] { teamsMiddleware }); + } + + [Fact] + public async Task Action_GetTeamChannelsError() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test); + } + + [Fact] + public async Task Action_GetTeamDetails() + { + var details = JObject.FromObject(new TeamDetails + { + Id = "19:generalChannelIdgeneralChannelId@thread.skype", + Name = "TeamName", + AadGroupId = "Team-aadGroupId" + }).ToString(); + + var uriToContent = new Dictionary() + { + { "/v3/teams/team-id-1/team-id-1", details }, + { "/v3/teams/customTeamId", details } + }; + + var teamsMiddleware = GetTeamsMiddleware(uriToContent); + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, middleware: new[] { teamsMiddleware }); + } + + [Fact] + public async Task Action_GetTeamDetailsError() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test); + } + + [Fact] + public async Task Action_GetTeamMember() + { + var member = JObject.FromObject(GenerateTeamMembers(1).Members.First()).ToString(); + + var uriToContent = new Dictionary() + { + { "/v3/conversations/team-id-1/members/user1", member }, + { "/v3/conversations/customTeamId/members/customMemberId", member } + }; + + var teamsMiddleware = GetTeamsMiddleware(uriToContent); + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, middleware: new[] { teamsMiddleware }); + } + + [Fact] + public async Task Action_GetTeamMemberError() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test); + } + + [Fact] + public async Task Action_GetTeamMemberErrorWithAdapter() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + [Fact] + public async Task Action_SendAppBasedLinkQueryResponse() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + [Fact] + public async Task Action_SendAppBasedLinkQueryResponseError() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test); + } + + //[Fact] + //public async Task Action_SendMessageToTeamsChannel() + //{ + // NOTE: Current test adapter is not a BotFrameworkAdapter, + // and does not support mocking SendMessageToTeamsChannel + // var teamsMiddleware = GetTeamsMiddleware(new JObject(), "/v3/conversations"); + // await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, middleware: new[] { teamsMiddleware }); + //} + + [Fact] + public async Task Action_SendMessageToTeamsChannelError() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test); + } + + [Fact] + public async Task Action_SendMEActionResponse() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + [Fact] + public async Task Action_SendMEActionResponseError() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + [Fact] + public async Task Action_SendMEAttachmentsResponse() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + [Fact] + public async Task Action_SendMEAttachmentsResponseError() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test); + } + + [Fact] + public async Task Action_SendMEAuthResponse() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + //[Fact] + //public async Task Action_SendMEAuthResponseError() + //{ + // NOTE: Current test adapter is not a BotFrameworkAdapter, + // await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + //} + + [Fact] + public async Task Action_SendMEAuthResponseErrorWithAdapter() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test); + } + + [Fact] + public async Task Action_SendMEBotMessagePreviewResponse() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + [Fact] + public async Task Action_SendMEBotMessagePreviewResponseError() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test); + } + + [Fact] + public async Task Action_SendMEConfigQuerySettingUrlResponse() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + [Fact] + public async Task Action_SendMEConfigQuerySettingUrlResponseError() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test); + } + + [Fact] + public async Task Action_SendMEMessageResponse() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + [Fact] + public async Task Action_SendMEMessageResponseError() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test); + } + + [Fact] + public async Task Action_SendMESelectItemResponse() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + [Fact] + public async Task Action_SendMESelectItemResponseError() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test); + } + + [Fact] + public async Task Action_SendTaskModuleCardResponse() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + [Fact] + public async Task Action_SendTaskModuleCardResponseError() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer, adapterChannel: Channels.Test); + } + + [Fact] + public async Task Action_SendTaskModuleMessageResponse() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + [Fact] + public async Task Action_SendTaskModuleUrlResponse() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + [Fact] + public async Task Action_SendTaskModuleUrlResponseError() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + [Fact] + public async Task Action_SendTabCardResponseError() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + [Fact] + public async Task Action_SendTabCardResponse() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + [Fact] + public async Task Action_SendTabAuthResponseErrorWithAdapter() + { + await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + } + + //[Fact] + //public async Task Action_SendTabAuthResponseError() + //{ + // NOTE: Current test adapter is not a BotFrameworkAdapter, + // await TestUtils.RunTestScript(_resourceExplorerFixture.ResourceExplorer); + //} + + private IMiddleware GetErrorTeamsMiddleware(string exception) + { + // Create a connector client, setup with a custom httpclient which will + // throw an exception when the connectorclient's outgoing pipeline's SendAsync + // is called + var messageHandler = new ErrorHttpMessageHandler(exception); + return GetTestConnectorClientMiddleware(messageHandler); + } + + private ConversationReference GetGroupConversation() + { + return new ConversationReference + { + ChannelId = Channels.Msteams, + User = new ChannelAccount + { + Id = "29:User-Id", + Name = "User Name", + AadObjectId = "participant-aad-id" + }, + Conversation = new ConversationAccount + { + ConversationType = "groupChat", + TenantId = "tenantId-Guid", + Name = "group", + IsGroup = true, + Id = "19:groupChatId@thread.v2" + } + }; + } + + private TeamsPagedMembersResult GenerateTeamMembers(int total) + { + var accounts = new List(); + + for (int count = 0; count < total; count++) + { + accounts.Add(new TeamsChannelAccount + { + Id = $"29:User-Id-{count}", + Name = $"User Name-{count}", + AadObjectId = $"User-{count}-Object-Id", + Surname = $"Surname-{count}", + Email = $"User.{count}@microsoft.com", + UserPrincipalName = $"user{count}@microsoft.com", + TenantId = "tenant-id-1", + GivenName = "User" + }); + } + + return new TeamsPagedMembersResult() { Members = accounts }; + } + + private JObject GetParticipant(bool groupConversation = false) + { + return JObject.FromObject(new + { + id = "29:User-Id-0", + objectId = "User-0-Object-Id", + name = "User Name-0", + meeting = new { role = "Organizer" }, + surname = "Surname-0", + tenantId = "tenant-id-1", + userPrincipalName = "user0@microsoft.com", + user = new + { + userPrincipalName = "userPrincipalName-1", + }, + email = "User.0@microsoft.com", + givenName = "User", + conversation = new + { + id = groupConversation ? "19:groupChatId@thread.v2" : "a:oneOnOneConversationId", + name = groupConversation ? "group" : "oneOnOne", + tenantId = "tenantId-Guid", + conversationType = groupConversation ? "groupChat" : "personal", + isGroup = groupConversation, + } + }); + } + + private IMiddleware GetTeamsMiddleware(JObject result, string path = null) + { + // Create a connector client, setup with a custom httpclient which will return + // the desired result through the TestHttpMessageHandler. + TestsHttpMessageHandler messageHandler; + if (!string.IsNullOrEmpty(path)) + { + messageHandler = new TestsHttpMessageHandler(path, result.ToString()); + } + else + { + messageHandler = new TestsHttpMessageHandler(result.ToString()); + } + + return GetTestConnectorClientMiddleware(messageHandler); + } + + private IMiddleware GetTeamsMiddleware(Dictionary results) + { + // Create a connector client, setup with a custom httpclient which will return + // the desired result through the TestHttpMessageHandler. + var messageHandler = new TestsHttpMessageHandler(results); + return GetTestConnectorClientMiddleware(messageHandler); + } + + private TestConnectorClientMiddleware GetTestConnectorClientMiddleware(HttpMessageHandler messageHandler) + { + var testHttpClient = new HttpClient(messageHandler); + testHttpClient.BaseAddress = new Uri("https://localhost.coffee"); + var testConnectorClient = new ConnectorClient(new Uri("http://localhost.coffee/"), new MicrosoftAppCredentials(string.Empty, string.Empty), testHttpClient); + return new TestConnectorClientMiddleware(testConnectorClient); + } + + // This middleware sets the turnstate's connector client, + // so it will be found by the adapter, and a new one not created. + private class TestConnectorClientMiddleware : IMiddleware + { + private IConnectorClient _connectorClient; + + public TestConnectorClientMiddleware(IConnectorClient connectorClient) + { + _connectorClient = connectorClient; + } + + public Task OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken = default) + { + turnContext.TurnState.Add(_connectorClient); + return next(cancellationToken); + } + } + + private class ErrorHttpMessageHandler : HttpMessageHandler + { + private readonly string _error; + + public ErrorHttpMessageHandler(string error) + { + _error = error; + } + + protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) + { + throw new Exception(_error); + } + } + + // Message handler to mock returning a specific object when requested from a specified path. + private class TestsHttpMessageHandler : HttpMessageHandler + { + private Dictionary _uriToContent; + private string _content; + + public TestsHttpMessageHandler(string url, string content) + : this(new Dictionary() { { url, content } }) + { + } + + public TestsHttpMessageHandler(string content) + { + _content = content; + } + + public TestsHttpMessageHandler(Dictionary uriToContent) + { + _uriToContent = uriToContent; + } + + protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) + { + var response = new HttpResponseMessage(HttpStatusCode.OK); + if (!string.IsNullOrEmpty(_content)) + { + response.Content = new StringContent(_content); + } + else + { + var path = request.RequestUri.PathAndQuery; + foreach (var urlAndContent in _uriToContent) + { + if (urlAndContent.Key.Contains(path, System.StringComparison.OrdinalIgnoreCase)) + { + response.Content = new StringContent(urlAndContent.Value); + } + } + } + + return Task.FromResult(response); + } + } + } +} diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/ConditionalTests.cs b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/ConditionalTests.cs new file mode 100644 index 0000000000..8c744a42d9 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/ConditionalTests.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.IO; +using System.Threading.Tasks; +using Microsoft.Bot.Builder; +using Microsoft.Bot.Builder.Dialogs; +using Microsoft.Bot.Builder.Dialogs.Adaptive; +using Microsoft.Bot.Builder.Dialogs.Adaptive.Testing; +using Microsoft.Bot.Builder.Dialogs.Declarative; +using Microsoft.Bot.Builder.Dialogs.Declarative.Obsolete; +using Microsoft.Bot.Builder.Dialogs.Declarative.Resources; +using Xunit; + +namespace Microsoft.Bot.Components.Teams.Tests +{ + public class ConditionalTests + { + public ConditionalTests() + { + ComponentRegistration.Add(new DeclarativeComponentRegistration()); + ComponentRegistration.Add(new DialogsComponentRegistration()); + ComponentRegistration.Add(new AdaptiveComponentRegistration()); + ComponentRegistration.Add(new LanguageGenerationComponentRegistration()); + ComponentRegistration.Add(new AdaptiveTestingComponentRegistration()); + ComponentRegistration.Add(new DeclarativeComponentRegistrationBridge()); + + ResourceExplorer = new ResourceExplorer() + .AddFolder(Path.Combine(TestUtils.GetProjectPath(), "Tests", nameof(ConditionalTests)), monitorChanges: false); + } + + public static ResourceExplorer ResourceExplorer { get; set; } + + [Fact] + public async Task ConditionalsTests_OnTeamsActivityTypes() + { + await TestUtils.RunTestScript(ResourceExplorer); + } + } +} diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Microsoft.Bot.Components.Teams.Tests.csproj b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Microsoft.Bot.Components.Teams.Tests.csproj new file mode 100644 index 0000000000..112c033e7f --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Microsoft.Bot.Components.Teams.Tests.csproj @@ -0,0 +1,35 @@ + + + + netcoreapp2.1 + netcoreapp3.1 + netcoreapp2.1;netcoreapp3.1 + false + Debug;Release + latest + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + Always + + + + diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/ResourceExplorerFixture.cs b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/ResourceExplorerFixture.cs new file mode 100644 index 0000000000..7b2b192b71 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/ResourceExplorerFixture.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using Microsoft.Bot.Builder.Dialogs.Declarative.Resources; + +namespace Microsoft.Bot.Components.Teams.Tests +{ + public class ResourceExplorerFixture : IDisposable + { + private string _folderPath = string.Empty; + + public ResourceExplorerFixture() + { + ResourceExplorer = new ResourceExplorer(); + } + + public ResourceExplorer ResourceExplorer { get; private set; } + + public ResourceExplorerFixture Initialize(string resourceFolder) + { + if (_folderPath.Length == 0) + { + _folderPath = Path.Combine(TestUtils.GetProjectPath(), "Tests", resourceFolder); + ResourceExplorer = ResourceExplorer.AddFolder(_folderPath, monitorChanges: false); + } + + return this; + } + + public void Dispose() + { + _folderPath = string.Empty; + ResourceExplorer.Dispose(); + } + } +} diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/TestUtils.cs b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/TestUtils.cs new file mode 100644 index 0000000000..f8f136dc1b --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/TestUtils.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; +using Microsoft.Bot.Builder; +using Microsoft.Bot.Builder.Adapters; +using Microsoft.Bot.Builder.Dialogs.Adaptive.Testing; +using Microsoft.Bot.Builder.Dialogs.Declarative.Resources; +using Microsoft.Bot.Connector; +using Microsoft.Bot.Schema; +using Microsoft.Extensions.Configuration; + +namespace Microsoft.Bot.Components.Teams.Tests +{ + public class TestUtils + { + public static IConfiguration DefaultConfiguration { get; set; } = new ConfigurationBuilder().AddInMemoryCollection().Build(); + + public static string RootFolder { get; set; } = GetProjectPath(); + + public static IEnumerable GetTestScripts(string relativeFolder) + { + var testFolder = Path.GetFullPath(Path.Combine(RootFolder, PathUtils.NormalizePath(relativeFolder))); + return Directory.EnumerateFiles(testFolder, "*.test.dialog", SearchOption.AllDirectories).Select(s => new object[] { Path.GetFileName(s) }).ToArray(); + } + + public static async Task RunTestScript(ResourceExplorer resourceExplorer, string resourceId = null, IConfiguration configuration = null, [CallerMemberName] string testName = null, IEnumerable middleware = null, string adapterChannel = Channels.Msteams) + { + var storage = new MemoryStorage(); + var convoState = new ConversationState(storage); + var userState = new UserState(storage); + + var adapter = (TestAdapter)new TestAdapter(CreateConversation(adapterChannel, testName)); + + if (middleware != null) + { + foreach (var m in middleware) + { + adapter.Use(m); + } + } + + adapter.Use(new RegisterClassMiddleware(DefaultConfiguration)) + .UseStorage(storage) + .UseBotState(userState, convoState) + .Use(new TranscriptLoggerMiddleware(new TraceTranscriptLogger(traceActivity: false))); + + adapter.OnTurnError += async (context, err) => + { + if (err.Message.EndsWith("MemoryAssertion failed")) + { + throw err; + } + + await context.SendActivityAsync(err.Message); + }; + + var script = resourceExplorer.LoadType(resourceId ?? $"{testName}.test.dialog"); + script.Configuration = configuration ?? new ConfigurationBuilder().AddInMemoryCollection().Build(); + script.Description ??= resourceId; + await script.ExecuteAsync(adapter: adapter, testName: testName, resourceExplorer: resourceExplorer).ConfigureAwait(false); + } + + public static string GetProjectPath() + { + var parent = Environment.CurrentDirectory; + while (!string.IsNullOrEmpty(parent)) + { + if (Directory.EnumerateFiles(parent, "*proj").Any()) + { + break; + } + + parent = Path.GetDirectoryName(parent); + } + + return parent; + } + + public static ConversationReference CreateConversation(string channel, string conversationName) + { + return new ConversationReference + { + ChannelId = channel ?? Channels.Test, + ServiceUrl = "https://test.com", + User = new ChannelAccount("user1", "User1"), + Bot = new ChannelAccount("bot", "Bot"), + Conversation = new ConversationAccount(false, "personal", conversationName), + Locale = "en-US", + }; + } + } +} diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMeetingParticipant.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMeetingParticipant.test.dialog new file mode 100644 index 0000000000..a770c1cc0c --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMeetingParticipant.test.dialog @@ -0,0 +1,66 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.GetMeetingParticipant", + "property": "conversation.result" + }, + { + "$kind": "Teams.GetMeetingParticipant", + "property": "conversation.resultWithCustomProperties", + "meetingId": "customMeetingId", + "participantId": "customParticipantId", + "tenantId": "customTenantId" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "from": { + "id": "participant-id", + "aadObjectId": "participant-aad-id-1" + }, + "channelData": { + "tenant": { + "id": "tenant-id-1" + }, + "meeting": { + "id": "meeting-id-1" + } + } + } + }, + { + "$kind": "Microsoft.Test.MemoryAssertions", + "assertions": [ + "conversation.result.conversation.conversationType == 'personal'", + "conversation.result.conversation.id == 'a:oneOnOneConversationId'", + "conversation.result.conversation.isGroup == false", + "conversation.result.conversation.name == 'oneOnOne'", + "conversation.result.conversation.tenantId == 'tenantId-Guid'", + "conversation.result.meeting.role == 'Organizer'", + "conversation.result.user.userPrincipalName == 'userPrincipalName-1'", + "conversation.resultWithCustomProperties.conversation.conversationType == 'personal'", + "conversation.resultWithCustomProperties.conversation.id == 'a:oneOnOneConversationId'", + "conversation.resultWithCustomProperties.conversation.isGroup == false", + "conversation.resultWithCustomProperties.conversation.name == 'oneOnOne'", + "conversation.resultWithCustomProperties.conversation.tenantId == 'tenantId-Guid'", + "conversation.resultWithCustomProperties.meeting.role == 'Organizer'", + "conversation.resultWithCustomProperties.user.userPrincipalName == 'userPrincipalName-1'" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMeetingParticipantError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMeetingParticipantError.test.dialog new file mode 100644 index 0000000000..e4d8551cdd --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMeetingParticipantError.test.dialog @@ -0,0 +1,42 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.GetMeetingParticipant", + "property": "$result" + }, + { + "$kind": "Microsoft.SendActivity", + "activity": "${$result}" + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserSays", + "text": "hi" + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Teams.GetMeetingParticipant works only on the Teams channel." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMeetingParticipantErrorWithAdapter.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMeetingParticipantErrorWithAdapter.test.dialog new file mode 100644 index 0000000000..eab01c2edc --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMeetingParticipantErrorWithAdapter.test.dialog @@ -0,0 +1,43 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.GetMeetingParticipant", + "property": "$result", + "participantId": "=turn.channelData.doesNotExist" + }, + { + "$kind": "Microsoft.SendActivity", + "activity": "${$result}" + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserSays", + "text": "hi" + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Teams.GetMeetingParticipant could not determine the participant id by expression value provided. participantId is required." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMember.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMember.test.dialog new file mode 100644 index 0000000000..90d44b865c --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMember.test.dialog @@ -0,0 +1,65 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.GetMember", + "property": "conversation.result" + }, + { + "$kind": "Teams.GetMember", + "property": "conversation.resultWithCustomProperties", + "memberId": "customMemberId" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "from": { + "id": "member-id" + }, + "channelData": { + "tenant": { + "id": "tenant-id-1" + }, + "meeting": { + "id": "meeting-id-1" + } + } + } + }, + { + "$kind": "Microsoft.Test.MemoryAssertions", + "assertions": [ + "conversation.result.email == 'User.0@microsoft.com'", + "conversation.result.givenName == 'User'", + "conversation.result.id == '29:User-Id-0'", + "conversation.result.name == 'User Name-0'", + "conversation.result.objectId == 'User-0-Object-Id'", + "conversation.result.surname == 'Surname-0'", + "conversation.result.tenantId == 'tenant-id-1'", + "conversation.result.userPrincipalName == 'user0@microsoft.com'", + "conversation.resultWithCustomProperties.email == 'User.0@microsoft.com'", + "conversation.resultWithCustomProperties.givenName == 'User'", + "conversation.resultWithCustomProperties.id == '29:User-Id-0'", + "conversation.resultWithCustomProperties.name == 'User Name-0'", + "conversation.resultWithCustomProperties.objectId == 'User-0-Object-Id'", + "conversation.resultWithCustomProperties.surname == 'Surname-0'", + "conversation.resultWithCustomProperties.tenantId == 'tenant-id-1'", + "conversation.resultWithCustomProperties.userPrincipalName == 'user0@microsoft.com'" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMemberError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMemberError.test.dialog new file mode 100644 index 0000000000..03ed714e8c --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMemberError.test.dialog @@ -0,0 +1,42 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.GetMember", + "property": "$result" + }, + { + "$kind": "Microsoft.SendActivity", + "activity": "${$result}" + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserSays", + "text": "hi" + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Teams.GetMember works only on the Teams channel." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMemberErrorWithAdapter.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMemberErrorWithAdapter.test.dialog new file mode 100644 index 0000000000..70b25fc571 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMemberErrorWithAdapter.test.dialog @@ -0,0 +1,43 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.GetMember", + "property": "$result", + "memberId": "=turn.activity.channelData.doesNotExist" + }, + { + "$kind": "Microsoft.SendActivity", + "activity": "${$result}" + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserSays", + "text": "hi" + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Missing MemberId in Teams.GetMember." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedMembers.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedMembers.test.dialog new file mode 100644 index 0000000000..07dcae5c4f --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedMembers.test.dialog @@ -0,0 +1,68 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.GetPagedMembers", + "property": "conversation.result" + }, + { + "$kind": "Teams.GetPagedMembers", + "property": "conversation.resultWithCustomProperties", + "continuationToken": "token", + "pageSize": 2 + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "from": { + "id": "member-id" + }, + "channelData": { + "tenant": { + "id": "tenant-id-1" + }, + "meeting": { + "id": "meeting-id-1" + } + } + } + }, + { + "$kind": "Microsoft.Test.MemoryAssertions", + "assertions": [ + "conversation.result.continuationToken == 'token'", + "conversation.result.members[0].email == 'User.0@microsoft.com'", + "conversation.result.members[0].id == '29:User-Id-0'", + "conversation.result.members[0].objectId == 'User-0-Object-Id'", + "conversation.result.members[1].email == 'User.1@microsoft.com'", + "conversation.result.members[1].id == '29:User-Id-1'", + "conversation.result.members[1].objectId == 'User-1-Object-Id'", + "conversation.result.members[2].email == 'User.2@microsoft.com'", + "conversation.result.members[2].id == '29:User-Id-2'", + "conversation.result.members[2].objectId == 'User-2-Object-Id'", + "conversation.resultWithCustomProperties.continuationToken == 'customToken'", + "conversation.resultWithCustomProperties.members[0].email == 'User.0@microsoft.com'", + "conversation.resultWithCustomProperties.members[0].id == '29:User-Id-0'", + "conversation.resultWithCustomProperties.members[0].objectId == 'User-0-Object-Id'", + "conversation.resultWithCustomProperties.members[1].email == 'User.1@microsoft.com'", + "conversation.resultWithCustomProperties.members[1].id == '29:User-Id-1'", + "conversation.resultWithCustomProperties.members[1].objectId == 'User-1-Object-Id'", + "not(exists(conversation.resultWithCustomProperties.members[2]))" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedMembersError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedMembersError.test.dialog new file mode 100644 index 0000000000..2f2f705eb2 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedMembersError.test.dialog @@ -0,0 +1,42 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.GetPagedMembers", + "property": "$result" + }, + { + "$kind": "Microsoft.SendActivity", + "activity": "${$result}" + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserSays", + "text": "hi" + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Teams.GetPagedMembers works only on the Teams channel." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedTeamMembers.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedTeamMembers.test.dialog new file mode 100644 index 0000000000..559b99576c --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedTeamMembers.test.dialog @@ -0,0 +1,65 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.GetPagedTeamMembers", + "property": "conversation.result" + }, + { + "$kind": "Teams.GetPagedTeamMembers", + "property": "conversation.resultWithCustomProperties", + "continuationToken": "token", + "pageSize": 2 + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "channelData": { + "tenant": { + "id": "tenant-id-1" + }, + "team": { + "id": "team-id-1" + } + } + } + }, + { + "$kind": "Microsoft.Test.MemoryAssertions", + "assertions": [ + "conversation.result.continuationToken == 'token'", + "conversation.result.members[0].email == 'User.0@microsoft.com'", + "conversation.result.members[0].id == '29:User-Id-0'", + "conversation.result.members[0].objectId == 'User-0-Object-Id'", + "conversation.result.members[1].email == 'User.1@microsoft.com'", + "conversation.result.members[1].id == '29:User-Id-1'", + "conversation.result.members[1].objectId == 'User-1-Object-Id'", + "conversation.result.members[2].email == 'User.2@microsoft.com'", + "conversation.result.members[2].id == '29:User-Id-2'", + "conversation.result.members[2].objectId == 'User-2-Object-Id'", + "conversation.resultWithCustomProperties.continuationToken == 'customToken'", + "conversation.resultWithCustomProperties.members[0].email == 'User.0@microsoft.com'", + "conversation.resultWithCustomProperties.members[0].id == '29:User-Id-0'", + "conversation.resultWithCustomProperties.members[0].objectId == 'User-0-Object-Id'", + "conversation.resultWithCustomProperties.members[1].email == 'User.1@microsoft.com'", + "conversation.resultWithCustomProperties.members[1].id == '29:User-Id-1'", + "conversation.resultWithCustomProperties.members[1].objectId == 'User-1-Object-Id'", + "not(exists(conversation.resultWithCustomProperties.members[2]))" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedTeamMembersError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedTeamMembersError.test.dialog new file mode 100644 index 0000000000..f8b11b4486 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedTeamMembersError.test.dialog @@ -0,0 +1,42 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.GetPagedTeamMembers", + "property": "$result" + }, + { + "$kind": "Microsoft.SendActivity", + "activity": "${$result}" + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserSays", + "text": "hi" + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Teams.GetPagedTeamMembers works only on the Teams channel." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamChannels.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamChannels.test.dialog new file mode 100644 index 0000000000..a5e4697ba9 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamChannels.test.dialog @@ -0,0 +1,58 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.GetTeamChannels", + "property": "conversation.result" + }, + { + "$kind": "Teams.GetTeamChannels", + "property": "conversation.resultWithCustomProperties", + "teamId": "customTeamId" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "channelData": { + "tenant": { + "id": "tenant-id-1" + }, + "team": { + "id": "team-id-1" + } + } + } + }, + { + "$kind": "Microsoft.Test.MemoryAssertions", + "assertions": [ + "conversation.result[0].id == '19:ChannelIdgeneralChannelId@thread.skype'", + "conversation.result[0].name == 'Testing0'", + "conversation.result[1].id == '19:somechannelId2e5ab3df9ae9b594bdb@thread.skype'", + "conversation.result[1].name == 'Testing1'", + "conversation.result[2].id == '19:somechannelId388ade16aa4dd375e69@thread.skype'", + "conversation.result[2].name == 'Testing2'", + "conversation.resultWithCustomProperties[0].id == '19:ChannelIdgeneralChannelId@thread.skype'", + "conversation.resultWithCustomProperties[0].name == 'Testing0'", + "conversation.resultWithCustomProperties[1].id == '19:somechannelId2e5ab3df9ae9b594bdb@thread.skype'", + "conversation.resultWithCustomProperties[1].name == 'Testing1'", + "conversation.resultWithCustomProperties[2].id == '19:somechannelId388ade16aa4dd375e69@thread.skype'", + "conversation.resultWithCustomProperties[2].name == 'Testing2'" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamChannelsError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamChannelsError.test.dialog new file mode 100644 index 0000000000..7d6735ab0f --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamChannelsError.test.dialog @@ -0,0 +1,42 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.GetTeamChannels", + "property": "$result" + }, + { + "$kind": "Microsoft.SendActivity", + "activity": "${$result}" + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserSays", + "text": "hi" + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Teams.GetTeamChannels works only on the Teams channel." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamDetails.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamDetails.test.dialog new file mode 100644 index 0000000000..49d9f9068e --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamDetails.test.dialog @@ -0,0 +1,52 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.GetTeamDetails", + "property": "conversation.result" + }, + { + "$kind": "Teams.GetTeamDetails", + "property": "conversation.resultWithCustomProperties", + "teamId": "customTeamId" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "channelData": { + "tenant": { + "id": "tenant-id-1" + }, + "team": { + "id": "team-id-1" + } + } + } + }, + { + "$kind": "Microsoft.Test.MemoryAssertions", + "assertions": [ + "conversation.result.aadGroupId == 'Team-aadGroupId'", + "conversation.result.id == '19:generalChannelIdgeneralChannelId@thread.skype'", + "conversation.result.name == 'TeamName'", + "conversation.resultWithCustomProperties.aadGroupId == 'Team-aadGroupId'", + "conversation.resultWithCustomProperties.id == '19:generalChannelIdgeneralChannelId@thread.skype'", + "conversation.resultWithCustomProperties.name == 'TeamName'" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamDetailsError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamDetailsError.test.dialog new file mode 100644 index 0000000000..a501cfdbef --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamDetailsError.test.dialog @@ -0,0 +1,42 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.GetTeamDetails", + "property": "$result" + }, + { + "$kind": "Microsoft.SendActivity", + "activity": "${$result}" + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserSays", + "text": "hi" + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Teams.GetTeamDetails works only on the Teams channel." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamMember.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamMember.test.dialog new file mode 100644 index 0000000000..4a45b57cf6 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamMember.test.dialog @@ -0,0 +1,64 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "enableTrace": true, + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.GetTeamMember", + "property": "conversation.result" + }, + { + "$kind": "Teams.GetTeamMember", + "property": "conversation.resultWithCustomProperties", + "memberId": "customMemberId", + "teamId": "customTeamId" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "channelData": { + "tenant": { + "id": "tenant-id-1" + }, + "team": { + "id": "team-id-1" + } + } + } + }, + { + "$kind": "Microsoft.Test.MemoryAssertions", + "assertions": [ + "conversation.result.email == 'User.0@microsoft.com'", + "conversation.result.givenName == 'User'", + "conversation.result.id == '29:User-Id-0'", + "conversation.result.name == 'User Name-0'", + "conversation.result.objectId == 'User-0-Object-Id'", + "conversation.result.surname == 'Surname-0'", + "conversation.result.tenantId == 'tenant-id-1'", + "conversation.result.userPrincipalName == 'user0@microsoft.com'", + "conversation.resultWithCustomProperties.email == 'User.0@microsoft.com'", + "conversation.resultWithCustomProperties.givenName == 'User'", + "conversation.resultWithCustomProperties.id == '29:User-Id-0'", + "conversation.resultWithCustomProperties.name == 'User Name-0'", + "conversation.resultWithCustomProperties.objectId == 'User-0-Object-Id'", + "conversation.resultWithCustomProperties.surname == 'Surname-0'", + "conversation.resultWithCustomProperties.tenantId == 'tenant-id-1'", + "conversation.resultWithCustomProperties.userPrincipalName == 'user0@microsoft.com'" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamMemberError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamMemberError.test.dialog new file mode 100644 index 0000000000..6f97c8bc51 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamMemberError.test.dialog @@ -0,0 +1,42 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.GetTeamMember", + "property": "$result" + }, + { + "$kind": "Microsoft.SendActivity", + "activity": "${$result}" + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserSays", + "text": "hi" + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Teams.GetTeamMember works only on the Teams channel." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamMemberErrorWithAdapter.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamMemberErrorWithAdapter.test.dialog new file mode 100644 index 0000000000..ad843a82c7 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamMemberErrorWithAdapter.test.dialog @@ -0,0 +1,43 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.GetTeamMember", + "property": "$result", + "memberId": "=turn.activity.channelData.doesNotExist" + }, + { + "$kind": "Microsoft.SendActivity", + "activity": "${$result}" + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserSays", + "text": "hi" + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Missing MemberId in Teams.GetTeamMember." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendAppBasedLinkQueryResponse.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendAppBasedLinkQueryResponse.test.dialog new file mode 100644 index 0000000000..188d548469 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendAppBasedLinkQueryResponse.test.dialog @@ -0,0 +1,50 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendAppBasedLinkQueryResponse", + "card": { + "type": "message", + "attachments": [ + { + "contentType": "application/vnd.microsoft.card.thumbnail", + "content": { + "title": "card-title" + } + } + ] + } + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReplyActivity", + "assertions": [ + "type == 'invokeResponse'", + "conversation.id == 'Action_SendAppBasedLinkQueryResponse'", + "value.body.composeExtension.attachmentLayout == 'list'", + "value.body.composeExtension.type == 'result'", + "value.body.composeExtension.attachments[0].contentType == 'application/vnd.microsoft.card.thumbnail'", + "value.body.composeExtension.attachments[0].content.title == 'card-title'" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendAppBasedLinkQueryResponseError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendAppBasedLinkQueryResponseError.test.dialog new file mode 100644 index 0000000000..2323a1cb05 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendAppBasedLinkQueryResponseError.test.dialog @@ -0,0 +1,79 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "recognizer": { + "$kind": "Microsoft.RegexRecognizer", + "intents": [ + { + "intent": "NoCard", + "pattern": "NoCard" + }, + { + "intent": "NoAttachments", + "pattern": "NoAttachments" + } + ] + }, + "triggers": [ + { + "$kind": "Microsoft.OnIntent", + "intent": "NoCard", + "actions": [ + { + "$kind": "Teams.SendAppBasedLinkQueryResponse" + } + ] + }, + { + "$kind": "Microsoft.OnIntent", + "intent": "NoAttachments", + "actions": [ + { + "$kind": "Teams.SendAppBasedLinkQueryResponse", + "card": { + "type": "message" + } + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "NoCard", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "An activity with attachments is required for Teams.SendAppBasedLinkQueryResponse." + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "NoAttachments", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Invalid activity. An attachment is required for Teams.SendAppBasedLinkQueryResponse." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEActionResponse.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEActionResponse.test.dialog new file mode 100644 index 0000000000..4f83b08266 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEActionResponse.test.dialog @@ -0,0 +1,56 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendMEActionResponse", + "title": "some title", + "height": 1, + "width": 2, + "completionBotId": "someBotId", + "card": { + "type": "message", + "attachments": [ + { + "contentType": "application/vnd.microsoft.card.thumbnail", + "content": { + "title": "card-title" + } + } + ] + } + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReplyActivity", + "assertions": [ + "type == 'invokeResponse'", + "conversation.id == 'Action_SendMEActionResponse'", + "value.body.task.value.completionBotId == 'someBotId'", + "value.body.task.value.height == 1", + "value.body.task.value.title == 'some title'", + "value.body.task.value.width == 2", + "value.body.task.value.card.contentType == 'application/vnd.microsoft.card.thumbnail'", + "value.body.task.value.card.content.title == 'card-title'" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEActionResponseError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEActionResponseError.test.dialog new file mode 100644 index 0000000000..8fd4f9bb21 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEActionResponseError.test.dialog @@ -0,0 +1,54 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "recognizer": { + "$kind": "Microsoft.RegexRecognizer", + "intents": [ + { + "intent": "NoAttachments", + "pattern": "NoAttachments" + } + ] + }, + "triggers": [ + { + "$kind": "Microsoft.OnIntent", + "intent": "NoAttachments", + "actions": [ + { + "$kind": "Teams.SendMEActionResponse", + "card": { + "type": "message" + } + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "NoAttachments", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Missing attachments in Teams.SendMEActionResponse." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAttachmentsResponse.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAttachmentsResponse.test.dialog new file mode 100644 index 0000000000..5ae8adb325 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAttachmentsResponse.test.dialog @@ -0,0 +1,50 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendMEAttachmentsResponse", + "attachments": { + "type": "message", + "attachments": [ + { + "contentType": "application/vnd.microsoft.card.thumbnail", + "content": { + "title": "card-title" + } + } + ] + } + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReplyActivity", + "assertions": [ + "type == 'invokeResponse'", + "conversation.id == 'Action_SendMEAttachmentsResponse'", + "value.body.composeExtension.attachmentLayout == 'list'", + "value.body.composeExtension.type == 'result'", + "value.body.composeExtension.attachments[0].contentType == 'application/vnd.microsoft.card.thumbnail'", + "value.body.composeExtension.attachments[0].content.title == 'card-title'" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAttachmentsResponseError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAttachmentsResponseError.test.dialog new file mode 100644 index 0000000000..ed4f18b0b0 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAttachmentsResponseError.test.dialog @@ -0,0 +1,44 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendMEAttachmentsResponse", + "attachments": { + "type": "message" + } + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Missing attachments in Teams.SendMEAttachmentsResponse." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAuthResponse.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAuthResponse.test.dialog new file mode 100644 index 0000000000..6acfa74080 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAuthResponse.test.dialog @@ -0,0 +1,41 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendMEAuthResponse", + "connectionName": "testConnection", + "title": "test title" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReplyActivity", + "assertions": [ + "type == 'invokeResponse'", + "conversation.id == 'Action_SendMEAuthResponse'", + "value.body.composeExtension.type == 'auth'", + "value.body.composeExtension.suggestedActions.actions[0].title == 'test title'", + "value.body.composeExtension.suggestedActions.actions[0].type == 'openUrl'", + "startsWith(value.body.composeExtension.suggestedActions.actions[0].value, 'https://fake.com/oauthsignin/testConnection')" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAuthResponseError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAuthResponseError.test.dialog new file mode 100644 index 0000000000..b860a92226 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAuthResponseError.test.dialog @@ -0,0 +1,43 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendMEAuthResponse", + "connectionName": "someConnection", + "title": "someTitle" + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "NoConnectionName", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Teams.SendMEAuthResponse: not supported by the current adapter." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAuthResponseErrorWithAdapter.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAuthResponseErrorWithAdapter.test.dialog new file mode 100644 index 0000000000..7d7425ba9b --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAuthResponseErrorWithAdapter.test.dialog @@ -0,0 +1,88 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "recognizer": { + "$kind": "Microsoft.RegexRecognizer", + "intents": [ + { + "intent": "NoConnectionName", + "pattern": "NoConnectionName" + }, + { + "intent": "NoTitle", + "pattern": "NoTitle" + } + ] + }, + "triggers": [ + { + "$kind": "Microsoft.OnIntent", + "intent": "NoConnectionName", + "actions": [ + { + "$kind": "Teams.SendMEAuthResponse", + "connectionName": "=turn.channelData.DoesNotExist" + } + ] + }, + { + "$kind": "Microsoft.OnIntent", + "intent": "NoTitle", + "actions": [ + { + "$kind": "Teams.SendMEAuthResponse", + "connectionName": "testConnection", + "title": "=turn.channelData.doesNotExist" + } + ] + }, + { + "$kind": "Microsoft.OnIntent", + "intent": "NoAttachments", + "actions": [ + { + "$kind": "Teams.SendMEAuthResponse" + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "NoConnectionName", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "A valid ConnectionName is required for auth responses." + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "NoTitle", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "A valid Title is required for auth responses." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEBotMessagePreviewResponse.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEBotMessagePreviewResponse.test.dialog new file mode 100644 index 0000000000..74343b9138 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEBotMessagePreviewResponse.test.dialog @@ -0,0 +1,52 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendMEBotMessagePreviewResponse", + "card": { + "type": "message", + "attachments": [ + { + "contentType": "application/vnd.microsoft.card.thumbnail", + "content": { + "title": "card-title" + } + } + ] + } + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReplyActivity", + "assertions": [ + "type == 'invokeResponse'", + "conversation.id == 'Action_SendMEBotMessagePreviewResponse'", + "value.body.composeExtension.type == 'botMessagePreview'", + "value.body.composeExtension.activityPreview.attachmentLayout == 'list'", + "value.body.composeExtension.activityPreview.inputHint == 'acceptingInput'", + "value.body.composeExtension.activityPreview.type == 'message'", + "value.body.composeExtension.activityPreview.attachments[0].contentType == 'application/vnd.microsoft.card.thumbnail'", + "value.body.composeExtension.activityPreview.attachments[0].content.title == 'card-title'" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEBotMessagePreviewResponseError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEBotMessagePreviewResponseError.test.dialog new file mode 100644 index 0000000000..3ef5fd3bac --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEBotMessagePreviewResponseError.test.dialog @@ -0,0 +1,79 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "recognizer": { + "$kind": "Microsoft.RegexRecognizer", + "intents": [ + { + "intent": "NoCard", + "pattern": "NoCard" + }, + { + "intent": "NoAttachments", + "pattern": "NoAttachments" + } + ] + }, + "triggers": [ + { + "$kind": "Microsoft.OnIntent", + "intent": "NoCard", + "actions": [ + { + "$kind": "Teams.SendMEBotMessagePreviewResponse" + } + ] + }, + { + "$kind": "Microsoft.OnIntent", + "intent": "NoAttachments", + "actions": [ + { + "$kind": "Teams.SendMEBotMessagePreviewResponse", + "card": { + "type": "message" + } + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "NoCard", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "A valid Card is required for Teams.SendMEBotMessagePreviewResponse." + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "NoAttachments", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Invalid activity. An attachment is required for Teams.SendMEBotMessagePreviewResponse." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponse.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponse.test.dialog new file mode 100644 index 0000000000..65d8447602 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponse.test.dialog @@ -0,0 +1,39 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendMEConfigQuerySettingUrlResponse", + "configUrl": "someBaseUrl.com/somePage.html" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReplyActivity", + "assertions": [ + "type == 'invokeResponse'", + "conversation.id == 'Action_SendMEConfigQuerySettingUrlResponse'", + "value.body.composeExtension.type == 'config'", + "value.body.composeExtension.suggestedActions.actions[0].type == 'openUrl'", + "value.body.composeExtension.suggestedActions.actions[0].value == 'someBaseUrl.com/somePage.html'" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponseError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponseError.test.dialog new file mode 100644 index 0000000000..6245df449d --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponseError.test.dialog @@ -0,0 +1,32 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendMEConfigQuerySettingUrlResponse" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "ConfigUrl is required for Teams.SendMEConfigQuerySettingUrlResponse." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEMessageResponse.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEMessageResponse.test.dialog new file mode 100644 index 0000000000..0efa1dfde0 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEMessageResponse.test.dialog @@ -0,0 +1,38 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendMEMessageResponse", + "message": "i want to send this to the user" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReplyActivity", + "assertions": [ + "type == 'invokeResponse'", + "conversation.id == 'Action_SendMEMessageResponse'", + "value.body.composeExtension.type == 'message'", + "value.body.composeExtension.text == 'i want to send this to the user'" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEMessageResponseError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEMessageResponseError.test.dialog new file mode 100644 index 0000000000..6f4f595c4b --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEMessageResponseError.test.dialog @@ -0,0 +1,32 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendMEMessageResponse" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "A Message is required for Teams.SendMEMessageResponse." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMESelectItemResponse.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMESelectItemResponse.test.dialog new file mode 100644 index 0000000000..b9a8f8ddb2 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMESelectItemResponse.test.dialog @@ -0,0 +1,50 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendMESelectItemResponse", + "card": { + "type": "message", + "attachments": [ + { + "contentType": "application/vnd.microsoft.card.thumbnail", + "content": { + "title": "card-title" + } + } + ] + } + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReplyActivity", + "assertions": [ + "type == 'invokeResponse'", + "conversation.id == 'Action_SendMESelectItemResponse'", + "value.body.composeExtension.type == 'result'", + "value.body.composeExtension.attachmentLayout == 'list'", + "value.body.composeExtension.attachments[0].contentType == 'application/vnd.microsoft.card.thumbnail'", + "value.body.composeExtension.attachments[0].content.title == 'card-title'" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMESelectItemResponseError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMESelectItemResponseError.test.dialog new file mode 100644 index 0000000000..a78eb61c61 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMESelectItemResponseError.test.dialog @@ -0,0 +1,79 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "recognizer": { + "$kind": "Microsoft.RegexRecognizer", + "intents": [ + { + "intent": "NoCard", + "pattern": "NoCard" + }, + { + "intent": "NoAttachments", + "pattern": "NoAttachments" + } + ] + }, + "triggers": [ + { + "$kind": "Microsoft.OnIntent", + "intent": "NoCard", + "actions": [ + { + "$kind": "Teams.SendMESelectItemResponse" + } + ] + }, + { + "$kind": "Microsoft.OnIntent", + "intent": "NoAttachments", + "actions": [ + { + "$kind": "Teams.SendMESelectItemResponse", + "card": { + "type": "message" + } + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "NoCard", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "A valid card is required for Teams.SendMESelectItemResponse." + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "NoAttachments", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Invalid activity. An attachment is required for Teams.SendMESelectItemResponse." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMessageToTeamsChannel.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMessageToTeamsChannel.test.dialog new file mode 100644 index 0000000000..6996effedb --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMessageToTeamsChannel.test.dialog @@ -0,0 +1,63 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendMessageToTeamsChannel", + "conversationReferenceProperty": "conversation.result", + "activity": { + "type": "message", + "text": "This is a message to a Teams Channel" + } + }, + { + "$kind": "Teams.SendMessageToTeamsChannel", + "conversationReferenceProperty": "conversation.resultWithCustomProperties", + "activity": { + "type": "message", + "text": "This is a message to a Teams Channel with custom properties" + }, + "teamsChannelId": "customTeamsChannel" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "channelData": { + "channel": { + "id": "fakeTeamsChannelToSendTo" + } + } + } + }, + { + "$kind": "Microsoft.Test.MemoryAssertions", + "assertions": [ + "conversation.result.activityId == '0'", + "conversation.result.channelId == 'msteams'", + "conversation.result.conversation.conversationType == 'groupChat'", + "conversation.result.conversation.isGroup == true", + "conversation.result.conversation.name == 'group'", + "conversation.result.conversation.tenantId == 'tenantId-Guid'", + "conversation.resultWithCustomProperties.activityId == '0'", + "conversation.resultWithCustomProperties.channelId == 'msteams'", + "conversation.resultWithCustomProperties.conversation.conversationType == 'groupChat'", + "conversation.resultWithCustomProperties.conversation.isGroup == true", + "conversation.resultWithCustomProperties.conversation.name == 'group'", + "conversation.resultWithCustomProperties.conversation.tenantId == 'tenantId-Guid'" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMessageToTeamsChannelError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMessageToTeamsChannelError.test.dialog new file mode 100644 index 0000000000..19419f3b1c --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMessageToTeamsChannelError.test.dialog @@ -0,0 +1,37 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendMessageToTeamsChannel" + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserSays", + "text": "hi" + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Teams.SendMessageToTeamsChannel works only on the Teams channel." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabAuthResponseError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabAuthResponseError.test.dialog new file mode 100644 index 0000000000..b5e40d7263 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabAuthResponseError.test.dialog @@ -0,0 +1,43 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendTabAuthResponse", + "connectionName": "someConnection", + "title": "someTitle" + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "NoConnectionName", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Teams.SendTabAuthResponse: not supported by the current adapter." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabAuthResponseErrorWithAdapter.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabAuthResponseErrorWithAdapter.test.dialog new file mode 100644 index 0000000000..8172f1d27c --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabAuthResponseErrorWithAdapter.test.dialog @@ -0,0 +1,88 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "recognizer": { + "$kind": "Microsoft.RegexRecognizer", + "intents": [ + { + "intent": "NoConnectionName", + "pattern": "NoConnectionName" + }, + { + "intent": "NoTitle", + "pattern": "NoTitle" + } + ] + }, + "triggers": [ + { + "$kind": "Microsoft.OnIntent", + "intent": "NoConnectionName", + "actions": [ + { + "$kind": "Teams.SendTabAuthResponse", + "connectionName": "=turn.channelData.DoesNotExist" + } + ] + }, + { + "$kind": "Microsoft.OnIntent", + "intent": "NoTitle", + "actions": [ + { + "$kind": "Teams.SendTabAuthResponse", + "connectionName": "testConnection", + "title": "=turn.channelData.doesNotExist" + } + ] + }, + { + "$kind": "Microsoft.OnIntent", + "intent": "NoAttachments", + "actions": [ + { + "$kind": "Teams.SendTabAuthResponse" + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "NoConnectionName", + "name": "tab/fetch" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "A valid ConnectionName is required for auth responses." + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "NoTitle", + "name": "tab/fetch" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "A valid Title is required for auth responses." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabCardResponse.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabCardResponse.test.dialog new file mode 100644 index 0000000000..7e06e3ecde --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabCardResponse.test.dialog @@ -0,0 +1,66 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendTabCardResponse", + "cards": { + "type": "message", + "attachments": [ + { + "contentType": "application/vnd.microsoft.card.adaptive", + "content": { + "type": "AdaptiveCard", + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "version": "1.2", + "body": [ + { + "type": "Container", + "items": [ + { + "type": "RichTextBlock", + "inlines": [ + { + "type": "TextRun", + "text": "Success!" + } + ] + } + ] + } + ] + } + } + ] + } + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "name": "tab/fetch" + } + }, + { + "$kind": "Microsoft.Test.AssertReplyActivity", + "assertions": [ + "type == 'invokeResponse'", + "conversation.id == 'Action_SendTabCardResponse'", + "value.body.tab.type == 'continue'", + "value.body.tab.value.cards[0].card.body[0].items[0].inlines[0].text == 'Success!'" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabCardResponseError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabCardResponseError.test.dialog new file mode 100644 index 0000000000..1e8a6bdc8c --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabCardResponseError.test.dialog @@ -0,0 +1,79 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "recognizer": { + "$kind": "Microsoft.RegexRecognizer", + "intents": [ + { + "intent": "NoCard", + "pattern": "NoCard" + }, + { + "intent": "NoAttachments", + "pattern": "NoAttachments" + } + ] + }, + "triggers": [ + { + "$kind": "Microsoft.OnIntent", + "intent": "NoCard", + "actions": [ + { + "$kind": "Teams.SendTabCardResponse" + } + ] + }, + { + "$kind": "Microsoft.OnIntent", + "intent": "NoAttachments", + "actions": [ + { + "$kind": "Teams.SendTabCardResponse", + "cards": { + + } + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "NoCard", + "name": "tab/fetch" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Valid Cards are required for Teams.SendTabCardResponse." + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "NoAttachments", + "name": "tab/fetch" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Invalid activity. Attachment(s) are required for Teams.SendTabCardResponse." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleCardResponse.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleCardResponse.test.dialog new file mode 100644 index 0000000000..d3c0c285fd --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleCardResponse.test.dialog @@ -0,0 +1,56 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendTaskModuleCardResponse", + "title": "some title", + "height": 1, + "width": 2, + "completionBotId": "someBotId", + "card": { + "type": "message", + "attachments": [ + { + "contentType": "application/vnd.microsoft.card.thumbnail", + "content": { + "title": "card-title" + } + } + ] + } + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReplyActivity", + "assertions": [ + "type == 'invokeResponse'", + "conversation.id == 'Action_SendTaskModuleCardResponse'", + "value.body.task.value.completionBotId == 'someBotId'", + "value.body.task.value.height == 1", + "value.body.task.value.title == 'some title'", + "value.body.task.value.width == 2", + "value.body.task.value.card.contentType == 'application/vnd.microsoft.card.thumbnail'", + "value.body.task.value.card.content.title == 'card-title'" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleCardResponseError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleCardResponseError.test.dialog new file mode 100644 index 0000000000..20e353e108 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleCardResponseError.test.dialog @@ -0,0 +1,79 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "recognizer": { + "$kind": "Microsoft.RegexRecognizer", + "intents": [ + { + "intent": "NoCard", + "pattern": "NoCard" + }, + { + "intent": "NoAttachments", + "pattern": "NoAttachments" + } + ] + }, + "triggers": [ + { + "$kind": "Microsoft.OnIntent", + "intent": "NoCard", + "actions": [ + { + "$kind": "Teams.SendTaskModuleCardResponse" + } + ] + }, + { + "$kind": "Microsoft.OnIntent", + "intent": "NoAttachments", + "actions": [ + { + "$kind": "Teams.SendTaskModuleCardResponse", + "card": { + "type": "message" + } + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "NoCard", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "A valid Card is required for Teams.SendTaskModuleCardResponse." + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "NoAttachments", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Invalid activity. An attachment is required for Teams.SendTaskModuleCardResponse." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleMessageResponse.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleMessageResponse.test.dialog new file mode 100644 index 0000000000..5819cd6331 --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleMessageResponse.test.dialog @@ -0,0 +1,37 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendTaskModuleMessageResponse", + "message": "i want to send this to the user" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReplyActivity", + "assertions": [ + "type == 'invokeResponse'", + "conversation.id == 'Action_SendTaskModuleMessageResponse'", + "value.body.task.value == 'i want to send this to the user'" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleUrlResponse.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleUrlResponse.test.dialog new file mode 100644 index 0000000000..53a2d07eac --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleUrlResponse.test.dialog @@ -0,0 +1,47 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendTaskModuleUrlResponse", + "title": "some title", + "height": 1, + "width": 2, + "completionBotId": "someBotId", + "url": "http://thisIsTheMainUrl.com", + "fallbackUrl": "http://thisIsTheFallbackUrl.net/okay/falling/back_now" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReplyActivity", + "assertions": [ + "type == 'invokeResponse'", + "conversation.id == 'Action_SendTaskModuleUrlResponse'", + "value.body.task.value.completionBotId == 'someBotId'", + "value.body.task.value.height == 1", + "value.body.task.value.title == 'some title'", + "value.body.task.value.width == 2", + "value.body.task.value.url == 'http://thisIsTheMainUrl.com'", + "value.body.task.value.fallbackUrl == 'http://thisIsTheFallbackUrl.net/okay/falling/back_now'" + ] + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleUrlResponseError.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleUrlResponseError.test.dialog new file mode 100644 index 0000000000..e30217656b --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleUrlResponseError.test.dialog @@ -0,0 +1,42 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnUnknownIntent", + "actions": [ + { + "$kind": "Teams.SendTaskModuleUrlResponse", + "url": "=turn.channelData.doesNotExist" + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "message", + "text": "hi", + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "Missing Url for Teams.SendTaskModuleUrlResponse." + } + ] +} \ No newline at end of file diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ConditionalTests/ConditionalsTests_OnTeamsActivityTypes.test.dialog b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ConditionalTests/ConditionalsTests_OnTeamsActivityTypes.test.dialog new file mode 100644 index 0000000000..ef348c61ac --- /dev/null +++ b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ConditionalTests/ConditionalsTests_OnTeamsActivityTypes.test.dialog @@ -0,0 +1,616 @@ +{ + "$schema": "../../../tests.schema", + "$kind": "Microsoft.Test.Script", + "dialog": { + "$kind": "Microsoft.AdaptiveDialog", + "id": "planningTest", + "triggers": [ + { + "$kind": "Microsoft.OnInvokeActivity", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.activity.text}" + } + ] + }, + { + "$kind": "Microsoft.OnConversationUpdateActivity", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.activity.text}" + } + ] + }, + { + "$kind": "Teams.OnAppBasedLinkQuery", + "condition": "turn.activity.text == 'OnAppBasedLinkQuery'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnAppBasedLinkQuery" + } + ] + }, + { + "$kind": "Teams.OnCardAction", + "condition": "turn.activity.text == 'OnCardAction'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnCardAction" + } + ] + }, + { + "$kind": "Teams.OnChannelCreated", + "condition": "turn.activity.text == 'OnChannelCreated'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnChannelCreated" + } + ] + }, + { + "$kind": "Teams.OnChannelDeleted", + "condition": "turn.activity.text == 'OnChannelDeleted'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnChannelDeleted" + } + ] + }, + { + "$kind": "Teams.OnChannelRenamed", + "condition": "turn.activity.text == 'OnChannelRenamed'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnChannelRenamed" + } + ] + }, + { + "$kind": "Teams.OnChannelRestored", + "condition": "turn.activity.text == 'OnChannelRestored'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnChannelRestored" + } + ] + }, + { + "$kind": "Teams.OnFileConsent", + "condition": "turn.activity.text == 'OnFileConsent'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnFileConsent" + } + ] + }, + { + "$kind": "Teams.OnMECardButtonClicked", + "condition": "turn.activity.text == 'OnCardButtonClicked'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnCardButtonClicked" + } + ] + }, + { + "$kind": "Teams.OnMEConfigQuerySettingUrl", + "condition": "turn.activity.text == 'OnConfigurationQuerySettingUrl'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnConfigurationQuerySettingUrl" + } + ] + }, + { + "$kind": "Teams.OnMEConfigSetting", + "condition": "turn.activity.text == 'OnConfigurationSetting'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnConfigurationSetting" + } + ] + }, + { + "$kind": "Teams.OnMEFetchTask", + "condition": "turn.activity.text == 'OnFetchTask'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnFetchTask" + } + ] + }, + { + "$kind": "Teams.OnMEQuery", + "condition": "turn.activity.text == 'OnQuery'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnQuery" + } + ] + }, + { + "$kind": "Teams.OnMESelectItem", + "condition": "turn.activity.text == 'OnSelectItem'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnSelectItem" + } + ] + }, + { + "$kind": "Teams.OnMESubmitAction", + "condition": "turn.activity.text == 'OnSubmitAction'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnSubmitAction" + } + ] + }, + { + "$kind": "Teams.OnO365ConnectorCardAction", + "condition": "turn.activity.text == 'OnO365ConnectorCardAction'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnO365ConnectorCardAction" + } + ] + }, + { + "$kind": "Teams.OnTaskModuleFetch", + "condition": "turn.activity.text == 'OnTaskModuleFetch'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnTaskModuleFetch" + } + ] + }, + { + "$kind": "Teams.OnTabFetch", + "condition": "turn.activity.text == 'OnTabFetch'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnTabFetch" + } + ] + }, + { + "$kind": "Teams.OnTaskModuleSubmit", + "condition": "turn.activity.text == 'OnTaskModuleSubmit'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnTaskModuleSubmit" + } + ] + }, + { + "$kind": "Teams.OnTabSubmit", + "condition": "turn.activity.text == 'OnTabSubmit'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnTabSubmit" + } + ] + }, + { + "$kind": "Teams.OnTeamArchived", + "condition": "turn.activity.text == 'OnTeamArchived'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnTeamArchived" + } + ] + }, + { + "$kind": "Teams.OnTeamDeleted", + "condition": "turn.activity.text == 'OnTeamDeleted'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnTeamDeleted" + } + ] + }, + { + "$kind": "Teams.OnTeamHardDeleted", + "condition": "turn.activity.text == 'OnTeamHardDeleted'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnTeamHardDeleted" + } + ] + }, + { + "$kind": "Teams.OnTeamRenamed", + "condition": "turn.activity.text == 'OnTeamRenamed'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnTeamRenamed" + } + ] + }, + { + "$kind": "Teams.OnTeamRestored", + "condition": "turn.activity.text == 'OnTeamRestored'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnTeamRestored" + } + ] + }, + { + "$kind": "Teams.OnTeamUnarchived", + "condition": "turn.activity.text == 'OnTeamUnarchived'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnTeamUnarchived" + } + ] + } + ], + "autoEndDialog": false, + "defaultResultProperty": "dialog.result" + }, + "script": [ + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "invoke", + "text": "OnAppBasedLinkQuery", + "value": {}, + "name": "composeExtension/queryLink" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnAppBasedLinkQuery" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "invoke", + "text": "OnCardAction", + "value": {} + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnCardAction" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "conversationUpdate", + "text": "OnChannelCreated", + "channelData": { + "eventType": "channelCreated" + } + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnChannelCreated" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "conversationUpdate", + "text": "OnChannelDeleted", + "channelData": { + "eventType": "channelDeleted" + } + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnChannelDeleted" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "conversationUpdate", + "text": "OnChannelRenamed", + "channelData": { + "eventType": "channelRenamed" + } + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnChannelRenamed" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "conversationUpdate", + "text": "OnChannelRestored", + "channelData": { + "eventType": "channelRestored" + } + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnChannelRestored" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "invoke", + "text": "OnFileConsent", + "value": {}, + "name": "fileConsent/invoke" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnFileConsent" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "invoke", + "text": "OnCardButtonClicked", + "value": {}, + "name": "composeExtension/onCardButtonClicked" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnCardButtonClicked" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "invoke", + "text": "OnConfigurationQuerySettingUrl", + "value": {}, + "name": "composeExtension/querySettingUrl" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnConfigurationQuerySettingUrl" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "invoke", + "text": "OnConfigurationSetting", + "value": {}, + "name": "composeExtension/setting" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnConfigurationSetting" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "invoke", + "text": "OnFetchTask", + "value": {}, + "name": "composeExtension/fetchTask" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnFetchTask" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "invoke", + "text": "OnQuery", + "value": {}, + "name": "composeExtension/query" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnQuery" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "invoke", + "text": "OnSelectItem", + "value": {}, + "name": "composeExtension/selectItem" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnSelectItem" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "invoke", + "text": "OnSubmitAction", + "value": {}, + "name": "composeExtension/submitAction" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnSubmitAction" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "invoke", + "text": "OnO365ConnectorCardAction", + "value": {}, + "name": "actionableMessage/executeAction" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnO365ConnectorCardAction" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "invoke", + "text": "OnTabFetch", + "value": {}, + "name": "tab/fetch" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnTabFetch" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "invoke", + "text": "OnTaskModuleFetch", + "value": {}, + "name": "task/fetch" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnTaskModuleFetch" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "invoke", + "text": "OnTabSubmit", + "value": {}, + "name": "tab/submit" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnTabSubmit" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "invoke", + "text": "OnTaskModuleSubmit", + "value": {}, + "name": "task/submit" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnTaskModuleSubmit" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "conversationUpdate", + "text": "OnTeamArchived", + "channelData": { + "eventType": "teamArchived" + } + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnTeamArchived" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "conversationUpdate", + "text": "OnTeamDeleted", + "channelData": { + "eventType": "teamDeleted" + } + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnTeamDeleted" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "conversationUpdate", + "text": "OnTeamHardDeleted", + "channelData": { + "eventType": "teamHardDeleted" + } + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnTeamHardDeleted" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "conversationUpdate", + "text": "OnTeamRenamed", + "channelData": { + "eventType": "teamRenamed" + } + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnTeamRenamed" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "conversationUpdate", + "text": "OnTeamRestored", + "channelData": { + "eventType": "teamRestored" + } + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnTeamRestored" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "conversationUpdate", + "text": "OnTeamUnarchived", + "channelData": { + "eventType": "teamUnarchived" + } + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnTeamUnarchived" + } + ] +} \ No newline at end of file diff --git a/tests/unit/skills/calendar/Microsoft.Bot.Dialogs.Tests.Skills.Calendar.csproj b/tests/unit/skills/calendar/Microsoft.Bot.Dialogs.Tests.Skills.Calendar.csproj index e98d945c2c..93b95eb1d3 100644 --- a/tests/unit/skills/calendar/Microsoft.Bot.Dialogs.Tests.Skills.Calendar.csproj +++ b/tests/unit/skills/calendar/Microsoft.Bot.Dialogs.Tests.Skills.Calendar.csproj @@ -7,10 +7,10 @@ - - - - + + + + diff --git a/tests/unit/skills/common/Microsoft.Bot.Dialogs.Tests.Common.csproj b/tests/unit/skills/common/Microsoft.Bot.Dialogs.Tests.Common.csproj index 05c521c926..ece7e9b098 100644 --- a/tests/unit/skills/common/Microsoft.Bot.Dialogs.Tests.Common.csproj +++ b/tests/unit/skills/common/Microsoft.Bot.Dialogs.Tests.Common.csproj @@ -6,10 +6,10 @@ - - - - + + + + diff --git a/tests/unit/skills/people/Microsoft.Bot.Dialogs.Tests.Skills.People.csproj b/tests/unit/skills/people/Microsoft.Bot.Dialogs.Tests.Skills.People.csproj index 02c6c2f4e2..b668550578 100644 --- a/tests/unit/skills/people/Microsoft.Bot.Dialogs.Tests.Skills.People.csproj +++ b/tests/unit/skills/people/Microsoft.Bot.Dialogs.Tests.Skills.People.csproj @@ -6,10 +6,10 @@ - - - - + + + + diff --git a/yarn.lock b/yarn.lock index faed4e0a0e..9687cc799a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -99,25 +99,25 @@ __metadata: "@types/lodash": ^4.14.168 "@typescript-eslint/eslint-plugin": latest "@typescript-eslint/parser": latest - adaptive-expressions: 4.13.4 - botbuilder: 4.13.4 - botbuilder-dialogs: 4.13.4 - botbuilder-dialogs-adaptive: 4.13.4-preview - botbuilder-dialogs-adaptive-runtime-core: 4.13.4-preview - botbuilder-dialogs-declarative: 4.13.4-preview - botbuilder-stdlib: 4.13.4-internal + adaptive-expressions: 4.14.0-rc0 + botbuilder: 4.14.0-rc0 + botbuilder-dialogs: 4.14.0-rc0 + botbuilder-dialogs-adaptive: ~4.14.0-preview.rc0 + botbuilder-dialogs-adaptive-runtime-core: ~4.14.0-preview.rc0 + botbuilder-dialogs-declarative: ~4.14.0-preview.rc0 + botbuilder-stdlib: ~4.14.0-internal.rc0 eslint: latest lodash: ^4.17.21 rimraf: ^3.0.2 typescript: ^4.0.5 peerDependencies: - adaptive-expressions: ~4.13.4 - botbuilder: ~4.13.4 - botbuilder-dialogs: ~4.13.4 - botbuilder-dialogs-adaptive: ~4.13.4-preview - botbuilder-dialogs-adaptive-runtime-core: ~4.13.4-preview - botbuilder-dialogs-declarative: ~4.13.4-preview - botbuilder-stdlib: ~4.13.4-internal + adaptive-expressions: ~4.14.0-rc0 + botbuilder: ~4.14.0-rc0 + botbuilder-dialogs: ~4.14.0-rc0 + botbuilder-dialogs-adaptive: ~4.14.0-preview.rc0 + botbuilder-dialogs-adaptive-runtime-core: ~4.14.0-preview.rc0 + botbuilder-dialogs-declarative: ~4.14.0-preview.rc0 + botbuilder-stdlib: ~4.14.0-internal.rc0 lodash: ^4.17.21 languageName: unknown linkType: soft @@ -134,7 +134,7 @@ __metadata: languageName: unknown linkType: soft -"@microsoft/generator-bot-adaptive@workspace:^1.0.0, @microsoft/generator-bot-adaptive@workspace:generators/generator-bot-adaptive": +"@microsoft/generator-bot-adaptive@workspace:^1.0.1, @microsoft/generator-bot-adaptive@workspace:generators/generator-bot-adaptive": version: 0.0.0-use.local resolution: "@microsoft/generator-bot-adaptive@workspace:generators/generator-bot-adaptive" dependencies: @@ -157,7 +157,7 @@ __metadata: version: 0.0.0-use.local resolution: "@microsoft/generator-bot-core-assistant@workspace:generators/generator-bot-core-assistant" dependencies: - "@microsoft/generator-bot-adaptive": "workspace:^1.0.0" + "@microsoft/generator-bot-adaptive": "workspace:^1.0.1" eslint: latest eslint-config-prettier: latest eslint-plugin-prettier: latest @@ -171,7 +171,7 @@ __metadata: version: 0.0.0-use.local resolution: "@microsoft/generator-bot-core-language@workspace:generators/generator-bot-core-language" dependencies: - "@microsoft/generator-bot-adaptive": "workspace:^1.0.0" + "@microsoft/generator-bot-adaptive": "workspace:^1.0.1" eslint: latest eslint-config-prettier: latest eslint-plugin-prettier: latest @@ -185,7 +185,7 @@ __metadata: version: 0.0.0-use.local resolution: "@microsoft/generator-bot-core-qna@workspace:generators/generator-bot-core-qna" dependencies: - "@microsoft/generator-bot-adaptive": "workspace:^1.0.0" + "@microsoft/generator-bot-adaptive": "workspace:^1.0.1" eslint: latest eslint-config-prettier: latest eslint-plugin-prettier: latest @@ -199,7 +199,7 @@ __metadata: version: 0.0.0-use.local resolution: "@microsoft/generator-bot-empty@workspace:generators/generator-bot-empty" dependencies: - "@microsoft/generator-bot-adaptive": "workspace:^1.0.0" + "@microsoft/generator-bot-adaptive": "workspace:^1.0.1" eslint: latest eslint-config-prettier: latest eslint-plugin-prettier: latest @@ -213,9 +213,9 @@ __metadata: version: 0.0.0-use.local resolution: "@microsoft/generator-bot-enterprise-assistant@workspace:generators/generator-bot-enterprise-assistant" dependencies: - "@microsoft/generator-bot-adaptive": "workspace:^1.0.0" - "@microsoft/generator-bot-enterprise-calendar": "workspace:^1.0.0" - "@microsoft/generator-bot-enterprise-people": "workspace:^1.0.0" + "@microsoft/generator-bot-adaptive": "workspace:^1.0.1" + "@microsoft/generator-bot-enterprise-calendar": "workspace:^1.0.1" + "@microsoft/generator-bot-enterprise-people": "workspace:^1.0.1" eslint: latest eslint-config-prettier: latest eslint-plugin-prettier: latest @@ -226,11 +226,11 @@ __metadata: languageName: unknown linkType: soft -"@microsoft/generator-bot-enterprise-calendar@workspace:^1.0.0, @microsoft/generator-bot-enterprise-calendar@workspace:generators/generator-bot-enterprise-calendar": +"@microsoft/generator-bot-enterprise-calendar@workspace:^1.0.1, @microsoft/generator-bot-enterprise-calendar@workspace:generators/generator-bot-enterprise-calendar": version: 0.0.0-use.local resolution: "@microsoft/generator-bot-enterprise-calendar@workspace:generators/generator-bot-enterprise-calendar" dependencies: - "@microsoft/generator-bot-adaptive": "workspace:^1.0.0" + "@microsoft/generator-bot-adaptive": "workspace:^1.0.1" eslint: latest eslint-config-prettier: latest eslint-plugin-prettier: latest @@ -240,11 +240,11 @@ __metadata: languageName: unknown linkType: soft -"@microsoft/generator-bot-enterprise-people@workspace:^1.0.0, @microsoft/generator-bot-enterprise-people@workspace:generators/generator-bot-enterprise-people": +"@microsoft/generator-bot-enterprise-people@workspace:^1.0.1, @microsoft/generator-bot-enterprise-people@workspace:generators/generator-bot-enterprise-people": version: 0.0.0-use.local resolution: "@microsoft/generator-bot-enterprise-people@workspace:generators/generator-bot-enterprise-people" dependencies: - "@microsoft/generator-bot-adaptive": "workspace:^1.0.0" + "@microsoft/generator-bot-adaptive": "workspace:^1.0.1" eslint: latest eslint-config-prettier: latest eslint-plugin-prettier: latest @@ -523,6 +523,22 @@ __metadata: languageName: node linkType: hard +"@types/lodash.isequal@npm:^4.5.5": + version: 4.5.5 + resolution: "@types/lodash.isequal@npm:4.5.5" + dependencies: + "@types/lodash": "*" + checksum: 141df617686010657bb3e46b21facce2dd15b771fdfebd9df2f3d6fd3603d6336b64da4027257402c640f71b65d91eca9305b53d282cf604bcbb88e662034aad + languageName: node + linkType: hard + +"@types/lodash@npm:*": + version: 4.14.170 + resolution: "@types/lodash@npm:4.14.170" + checksum: 5ecc968649e764e3204435ba5125a3645e5e83963069a26b9307791698bf47ed9c2bd0f97488d9537eb4753d4bae596e5fa6187437a5b04bf47aba78fa553d50 + languageName: node + linkType: hard + "@types/lodash@npm:^4.14.168": version: 4.14.168 resolution: "@types/lodash@npm:4.14.168" @@ -792,30 +808,31 @@ __metadata: languageName: node linkType: hard -"adal-node@npm:0.2.1": - version: 0.2.1 - resolution: "adal-node@npm:0.2.1" +"adal-node@npm:0.2.2": + version: 0.2.2 + resolution: "adal-node@npm:0.2.2" dependencies: "@types/node": ^8.0.47 async: ^2.6.3 + axios: ^0.21.1 date-utils: "*" jws: 3.x.x - request: ^2.88.0 underscore: ">= 1.3.1" uuid: ^3.1.0 xmldom: ">= 0.1.x" xpath.js: ~1.1.0 - checksum: 93cbb8a159873865996194cbc0ef2036927622c8ff21d2be0b093a476785b6d31e97cba80bc23fdd4ff0714aae62a43f507e3742a7c27e5ced92078519ecd554 + checksum: eafd8acda0ff50d57ce5939a801f6d72596aaeea26798d3ca006af713abd124d942f1a83d338c1472c23ca743b1940a7dc27e67b0bd63efb44e0568f6c2a96a8 languageName: node linkType: hard -"adaptive-expressions@npm:4.13.4": - version: 4.13.4 - resolution: "adaptive-expressions@npm:4.13.4" +"adaptive-expressions@npm:4.14.0-rc0": + version: 4.14.0-rc0 + resolution: "adaptive-expressions@npm:4.14.0-rc0" dependencies: "@microsoft/recognizers-text-data-types-timex-expression": 1.3.0 "@types/atob-lite": ^2.0.0 "@types/btoa-lite": ^1.0.0 + "@types/lodash.isequal": ^4.5.5 "@types/lru-cache": ^5.1.0 "@types/xmldom": ^0.1.30 antlr4ts: 0.5.0-alpha.3 @@ -825,13 +842,14 @@ __metadata: d3-format: ^1.4.4 dayjs: ^1.10.3 jspath: ^0.4.0 + lodash.isequal: ^4.5.0 lru-cache: ^5.1.1 uuid: ^8.3.2 x2js: ^3.4.0 xml2js: ^0.4.23 xmldom: ^0.5.0 xpath: ^0.0.32 - checksum: fc5a86ec925509d28275eec36a9285e8beb67a6b5b670de77a858ab9ea95cb03b53737f3dc657f4d5ce90275d60c7a98fef0c72dbb9ac69756c66e8678757e57 + checksum: efb2c322116fe5385ea7b9daade4656c5569b0bfb63ee15e9d756a73d100ebaba0fbfa342bd1c7091eb82c4092b64cd3730ada9ccb008413cad3c8d91e9d507d languageName: node linkType: hard @@ -1122,16 +1140,6 @@ __metadata: languageName: node linkType: hard -"assert@npm:^1.4.1": - version: 1.5.0 - resolution: "assert@npm:1.5.0" - dependencies: - object-assign: ^4.1.1 - util: 0.10.3 - checksum: 9bd01a7a574d99656d3998b95e904c35fe41c9e18b8193a4b1bb3b1df2772f4fb03bf75897093daca9d883ed888d9be5da2a9a952da6f1da9101f4147a2f00c1 - languageName: node - linkType: hard - "assign-symbols@npm:^1.0.0": version: 1.0.0 resolution: "assign-symbols@npm:1.0.0" @@ -1519,156 +1527,154 @@ __metadata: languageName: node linkType: hard -"botbuilder-core@npm:4.13.4": - version: 4.13.4 - resolution: "botbuilder-core@npm:4.13.4" +"botbuilder-core@npm:4.14.0-rc0": + version: 4.14.0-rc0 + resolution: "botbuilder-core@npm:4.14.0-rc0" dependencies: - assert: ^1.4.1 - botbuilder-dialogs-adaptive-runtime-core: 4.13.4-preview - botbuilder-stdlib: 4.13.4-internal - botframework-connector: 4.13.4 - botframework-schema: 4.13.4 + botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview.rc0 + botbuilder-stdlib: 4.14.0-internal.rc0 + botframework-connector: 4.14.0-rc0 + botframework-schema: 4.14.0-rc0 uuid: ^8.3.2 - checksum: 6aaff87b1213008c6f3f49efb066a2866a89017bea3cf8b521842387068fafe74854f188df5a9c3753e767d9a72a9c63a1f964232f4b1bf2d9ded04dfb70efbd + zod: ~1.11.17 + checksum: 5e7aa040d6d0e0f2a130e197e8be4472e3bf33562e10fe0dad2843c67dc7f93f53b793626f371af544429473acd75901c4a413835ab96ec01be6833cb1b73956 languageName: node linkType: hard -"botbuilder-dialogs-adaptive-runtime-core@npm:4.13.4-preview": - version: 4.13.4-preview - resolution: "botbuilder-dialogs-adaptive-runtime-core@npm:4.13.4-preview" +"botbuilder-dialogs-adaptive-runtime-core@npm:4.14.0-preview.rc0, botbuilder-dialogs-adaptive-runtime-core@npm:~4.14.0-preview.rc0": + version: 4.14.0-preview.rc0 + resolution: "botbuilder-dialogs-adaptive-runtime-core@npm:4.14.0-preview.rc0" dependencies: dependency-graph: ^0.10.0 - runtypes: ~5.1.0 - checksum: 6cd8217d06c11ed97867967986af875d3ac1c8b404bc5ed57e9a8a3111cac1d9b22918eaabbb2a4497ce45d97e86add3e75b76ddf01b015c35daabe66675b552 + checksum: 0e74a0d0264a760f8ede0ce3652589767618df1f0182e4e845661fc69d45db29a573d7ae83c86e5f1162cf70e93743d774f1ec35c7fd3f87a3f5c53451dc9adc languageName: node linkType: hard -"botbuilder-dialogs-adaptive@npm:4.13.4-preview": - version: 4.13.4-preview - resolution: "botbuilder-dialogs-adaptive@npm:4.13.4-preview" +"botbuilder-dialogs-adaptive@npm:~4.14.0-preview.rc0": + version: 4.14.0-preview.rc0 + resolution: "botbuilder-dialogs-adaptive@npm:4.14.0-preview.rc0" dependencies: "@microsoft/recognizers-text-suite": 1.1.4 - adaptive-expressions: 4.13.4 - botbuilder: 4.13.4 - botbuilder-dialogs: 4.13.4 - botbuilder-dialogs-adaptive-runtime-core: 4.13.4-preview - botbuilder-dialogs-declarative: 4.13.4-preview - botbuilder-lg: 4.13.4 - botframework-connector: 4.13.4 - botframework-schema: 4.13.4 + adaptive-expressions: 4.14.0-rc0 + botbuilder: 4.14.0-rc0 + botbuilder-dialogs: 4.14.0-rc0 + botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview.rc0 + botbuilder-dialogs-declarative: 4.14.0-preview.rc0 + botbuilder-lg: 4.14.0-rc0 lodash: ^4.17.21 node-fetch: ^2.6.0 - checksum: d11907e44030b3dc2ed1c822679de512642ec1d0ad222d4e318292922c45d36cd37d82645f9835c4928065aca5cc75ab11f2e34aea124baac2b7ac6c0ab86686 + checksum: 22c93799df01a5620a6188f1be55d99f7dae17f7411846d98ff871cc5e60cbde61054a5f95493f0615d50c21a01f0de591d9ea3487757a382afc5fdc8278a5f6 languageName: node linkType: hard -"botbuilder-dialogs-declarative@npm:4.13.4-preview": - version: 4.13.4-preview - resolution: "botbuilder-dialogs-declarative@npm:4.13.4-preview" +"botbuilder-dialogs-declarative@npm:4.14.0-preview.rc0, botbuilder-dialogs-declarative@npm:~4.14.0-preview.rc0": + version: 4.14.0-preview.rc0 + resolution: "botbuilder-dialogs-declarative@npm:4.14.0-preview.rc0" dependencies: - botbuilder-core: 4.13.4 - botbuilder-dialogs: 4.13.4 - botbuilder-stdlib: 4.13.4-internal + botbuilder-core: 4.14.0-rc0 + botbuilder-dialogs: 4.14.0-rc0 + botbuilder-stdlib: 4.14.0-internal.rc0 chokidar: ^3.4.0 - checksum: e18d637ca5cff9d0df34d813ac57108a617bc989dc37ae85130a2dc8756e11bb695fa47b8283fea8e629f47acae65d067ef9bd064411e8d27fc82d0e053e4d15 + checksum: 62b8b7e0f52f2be96d221df0254875bf848ae91eb945c81f1c911ea65fd2d76ff51029673347932da77c424d4b205d1050fb975fea8edbb5ad035d818ac1cee7 languageName: node linkType: hard -"botbuilder-dialogs@npm:4.13.4": - version: 4.13.4 - resolution: "botbuilder-dialogs@npm:4.13.4" +"botbuilder-dialogs@npm:4.14.0-rc0": + version: 4.14.0-rc0 + resolution: "botbuilder-dialogs@npm:4.14.0-rc0" dependencies: "@microsoft/recognizers-text-choice": 1.1.4 "@microsoft/recognizers-text-date-time": 1.1.4 "@microsoft/recognizers-text-number": 1.1.4 "@microsoft/recognizers-text-suite": 1.1.4 - botbuilder-core: 4.13.4 - botbuilder-dialogs-adaptive-runtime-core: 4.13.4-preview - botbuilder-stdlib: 4.13.4-internal - botframework-connector: 4.13.4 + botbuilder-core: 4.14.0-rc0 + botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview.rc0 + botbuilder-stdlib: 4.14.0-internal.rc0 + botframework-connector: 4.14.0-rc0 globalize: ^1.4.2 lodash: ^4.17.21 - runtypes: ~5.1.0 - uuid: ^8.3.2 - checksum: b7ac611bbf67946d0e32383a2df03c8b16f15d80850bb2e235686d588150c015db8d3c1475cad7d452c03d61ac8c5d0e70e30e86508489936e9862090da9cbe7 + zod: ~1.11.17 + checksum: 77b6161bfc04e1e19ad2b0cd0ec96b073a1f617734f52697a7bb2ad21f470410eedeb54e604a414d997b6747b542a008753553f94e3b517724cbe8575fac68f2 languageName: node linkType: hard -"botbuilder-lg@npm:4.13.4": - version: 4.13.4 - resolution: "botbuilder-lg@npm:4.13.4" +"botbuilder-lg@npm:4.14.0-rc0": + version: 4.14.0-rc0 + resolution: "botbuilder-lg@npm:4.14.0-rc0" dependencies: - adaptive-expressions: 4.13.4 + adaptive-expressions: 4.14.0-rc0 antlr4ts: 0.5.0-alpha.3 lodash: ^4.17.19 - path: ^0.12.7 uuid: ^8.3.2 - checksum: d1788d7ad6cc6fc64d818b89200e7d65b2a3e62e26267838b6b5861030f46fd54250bb46e6aa6da4c04425e317c002c51d00d09c22b894468cecd27ab20c4ee6 + checksum: 40e02788ece6eafd553ca2b3bf3d29e9eae71b4c5d3a63e9d8e6b6c83675f37059049c28dee8106659ee5b9e94288148429aad4fad474bc01365c7fc49f6a5ef languageName: node linkType: hard -"botbuilder-stdlib@npm:4.13.4-internal": - version: 4.13.4-internal - resolution: "botbuilder-stdlib@npm:4.13.4-internal" - checksum: c6dd92a039fcca421841d9c0ebec88438152edcc8cab6ef16b2e3653c0cee5d287b4b0df02117c24b51af72a13c095c0b25e34fe2631cd5572addc15a8b735ce +"botbuilder-stdlib@npm:4.14.0-internal.rc0, botbuilder-stdlib@npm:~4.14.0-internal.rc0": + version: 4.14.0-internal.rc0 + resolution: "botbuilder-stdlib@npm:4.14.0-internal.rc0" + checksum: 2dfd1d9d7fe3ee0fc166277f6728ce07e6dc5c411af02f518d0cf4a684d0c735744330c652e83d884ee863c64a3ec76baf4132e07baaf0f8484926c749def05a languageName: node linkType: hard -"botbuilder@npm:4.13.4": - version: 4.13.4 - resolution: "botbuilder@npm:4.13.4" +"botbuilder@npm:4.14.0-rc0": + version: 4.14.0-rc0 + resolution: "botbuilder@npm:4.14.0-rc0" dependencies: "@azure/ms-rest-js": 1.9.1 axios: ^0.21.1 - botbuilder-core: 4.13.4 - botbuilder-dialogs-adaptive-runtime-core: 4.13.4-preview - botbuilder-stdlib: 4.13.4-internal - botframework-connector: 4.13.4 - botframework-streaming: 4.13.4 + botbuilder-core: 4.14.0-rc0 + botbuilder-stdlib: 4.14.0-internal.rc0 + botframework-connector: 4.14.0-rc0 + botframework-streaming: 4.14.0-rc0 dayjs: ^1.10.3 filenamify: ^4.1.0 fs-extra: ^7.0.1 htmlparser2: ^6.0.1 uuid: ^8.3.2 - checksum: 20b1ca64457e1c371401f3e79476d4395f829ef7c74ef529958d2a58f90c214f68e679c7c9d73beeee1ec94fda2ad41ad017778a9d05c55c11a0b36a5b11573e + zod: ~1.11.17 + checksum: 3d00f49a6dd34fb6bc6a63f5fb42645b5da87b3d2299576331c7a15e3b8e732a196181101fd62d13d7483a3c969b2fd8e3e623f15d4fce337b3ede87c99bec43 languageName: node linkType: hard -"botframework-connector@npm:4.13.4": - version: 4.13.4 - resolution: "botframework-connector@npm:4.13.4" +"botframework-connector@npm:4.14.0-rc0": + version: 4.14.0-rc0 + resolution: "botframework-connector@npm:4.14.0-rc0" dependencies: "@azure/ms-rest-js": 1.9.1 "@types/jsonwebtoken": 7.2.8 "@types/node": ^10.17.27 - adal-node: 0.2.1 + adal-node: 0.2.2 + axios: ^0.21.1 base64url: ^3.0.0 - botframework-schema: 4.13.4 + botbuilder-stdlib: 4.14.0-internal.rc0 + botframework-schema: 4.14.0-rc0 cross-fetch: ^3.0.5 jsonwebtoken: 8.0.1 rsa-pem-from-mod-exp: ^0.8.4 - checksum: 2d1ab8b2fd4af68634cb23e31014bbc5464abfe4d76722a275a551a0b81819f15ee89bc343a8a1b918498aecb062020d638a0b2ed3c660169bd005443986dc1d + checksum: 64331d4b0c62159487aba3dcfef2b5a8225967484e21badf4cc6d3dd3b1a5437863a6b8d90eb777428f4328204d61b28d956260ee5002c89a6cdd7b4a8a84f44 languageName: node linkType: hard -"botframework-schema@npm:4.13.4": - version: 4.13.4 - resolution: "botframework-schema@npm:4.13.4" +"botframework-schema@npm:4.14.0-rc0": + version: 4.14.0-rc0 + resolution: "botframework-schema@npm:4.14.0-rc0" dependencies: - botbuilder-stdlib: 4.13.4-internal - checksum: 5cf0ec42293396802b083e8099077fcb86e40ab41efd4b955aeb76253754b50f35e7d602bf3d88dafb90586bc05ad1d55d959f793333fce6f522d831a1e487ac + botbuilder-stdlib: 4.14.0-internal.rc0 + uuid: ^8.3.2 + checksum: 510bf414ba745f37bc227ca3bd4d15ec1b993effa879cfa92ef960f3c74c74b148463faf64fe5570e4fd70feac17edd128b21fd2245d77d6bfc25f13659c474d languageName: node linkType: hard -"botframework-streaming@npm:4.13.4": - version: 4.13.4 - resolution: "botframework-streaming@npm:4.13.4" +"botframework-streaming@npm:4.14.0-rc0": + version: 4.14.0-rc0 + resolution: "botframework-streaming@npm:4.14.0-rc0" dependencies: "@types/node": ^10.17.27 "@types/ws": ^6.0.3 uuid: ^8.3.2 ws: ^7.1.2 - checksum: b85af5123e04968e5cf89518f643531b15e33da0a42153b33ff8f6f39aebe6b2a5083707c6c6a87a45d755a5f6243216acaee9d3ca24338d2d207c6af05f4f4e + checksum: 3da7ae9029e040436d72a8b35ca29baa684608522a221ac81379eac1be1d74f1dedb19fc171cb09f6d75564496fb0e76ea3f67602e7bcf0b83f609809eab9d7c languageName: node linkType: hard @@ -4377,20 +4383,6 @@ fsevents@~2.3.1: languageName: node linkType: hard -"inherits@npm:2.0.1": - version: 2.0.1 - resolution: "inherits@npm:2.0.1" - checksum: 6f59f627a64cff6f4b5a2723184d831e6fc376cf88b8a94821caa2cad9d44da6d79583335024c01a541d9a25767785928a28f6e2192bb14be9ce800b315b4faa - languageName: node - linkType: hard - -"inherits@npm:2.0.3": - version: 2.0.3 - resolution: "inherits@npm:2.0.3" - checksum: 9488f9433effbc24474f6baee8014e5337c7f99305ecb4204fa5864ae7655c24225780d87fc65ed8d3d374715a18c5dc8c69fe3bf9745cde2e7acd0ac068a07b - languageName: node - linkType: hard - "ini@npm:~1.3.0": version: 1.3.8 resolution: "ini@npm:1.3.8" @@ -6845,7 +6837,7 @@ fsevents@~2.3.1: languageName: node linkType: hard -"object-assign@npm:^4.1.0, object-assign@npm:^4.1.1": +"object-assign@npm:^4.1.0": version: 4.1.1 resolution: "object-assign@npm:4.1.1" checksum: 66cf021898fc1b13ea573ea8635fbd5a76533f50cecbc2fcd5eee1e8029af41bcebe7023788b6d0e06cbe4401ecea075d972f78ec74467cdc571a0f1a4d1a081 @@ -7322,16 +7314,6 @@ fsevents@~2.3.1: languageName: node linkType: hard -"path@npm:^0.12.7": - version: 0.12.7 - resolution: "path@npm:0.12.7" - dependencies: - process: ^0.11.1 - util: ^0.10.3 - checksum: 0e2d3342ca6f91aba8e514919cae8a08ad12071297a3a99da6e3ea493f5296d9bb323ca9bece4d035fc280e91b701a740ce1e48ff65802004deaaae2f2cd623e - languageName: node - linkType: hard - "performance-now@npm:^2.1.0": version: 2.1.0 resolution: "performance-now@npm:2.1.0" @@ -7504,13 +7486,6 @@ fsevents@~2.3.1: languageName: node linkType: hard -"process@npm:^0.11.1": - version: 0.11.10 - resolution: "process@npm:0.11.10" - checksum: ed93a85e9185b40fb01788c588a87c1a9da0eb925ef7cebebbe1b8bbf0eba1802130366603a29e3b689c116969d4fe018de6aed3474bbeb5aefb3716b85d6449 - languageName: node - linkType: hard - "progress@npm:^2.0.0": version: 2.0.3 resolution: "progress@npm:2.0.3" @@ -7861,7 +7836,7 @@ fsevents@~2.3.1: languageName: node linkType: hard -"request@npm:^2.87.0, request@npm:^2.88.0, request@npm:^2.88.2": +"request@npm:^2.87.0, request@npm:^2.88.2": version: 2.88.2 resolution: "request@npm:2.88.2" dependencies: @@ -9291,24 +9266,6 @@ typescript@^4.0.5: languageName: node linkType: hard -"util@npm:0.10.3": - version: 0.10.3 - resolution: "util@npm:0.10.3" - dependencies: - inherits: 2.0.1 - checksum: 05c1a09f3af90250365386331b3986c0753af1900f20279f9302409b27e9d9d3c03a9cf4efba48aae859d04348ebfe56d68f89688113f61171da9c4fbe6baaca - languageName: node - linkType: hard - -"util@npm:^0.10.3": - version: 0.10.4 - resolution: "util@npm:0.10.4" - dependencies: - inherits: 2.0.3 - checksum: 6682ea8239076243495c45e81f19c2c002e02805de4de08554dc815500805923f27f504ec1a9c7599d420b62bf7452efbab6fa078219d529188b0ca830f142a5 - languageName: node - linkType: hard - "uuid@npm:^3.1.0, uuid@npm:^3.2.1, uuid@npm:^3.3.2": version: 3.4.0 resolution: "uuid@npm:3.4.0" @@ -9966,3 +9923,10 @@ typescript@^4.0.5: checksum: 096c3b40beb2804659539be1605a35c58eb0c85285f94b77b3e924f42ee265c1a40bf9f4153770039517146b469a964d51742395f35ca8135fc9f7e4982b785d languageName: node linkType: hard + +"zod@npm:~1.11.17": + version: 1.11.17 + resolution: "zod@npm:1.11.17" + checksum: 27e8799fa87ea4478a3155f40c39c4bef331b3c3273f00252ca646879c92eef54a5c36dcf31b6cd29bfd723fa4c1502e24d59e252d657183eab1252f273dfd7f + languageName: node + linkType: hard