From 669150a06ffc18fcf74d26111ff50ac27fba5cf9 Mon Sep 17 00:00:00 2001 From: Michael Richardson Date: Tue, 6 Jul 2021 14:51:14 -0700 Subject: [PATCH 01/10] move .NET tests --- tests/unit/Microsoft.Bot.Components.Tests.sln | 14 +- .../ActionTests.cs | 592 ----------------- .../ConditionalTests.cs | 40 -- ...icrosoft.Bot.Components.Teams.Tests.csproj | 35 - .../ResourceExplorerFixture.cs | 38 -- .../TestUtils.cs | 98 --- .../Action_GetMeetingParticipant.test.dialog | 66 -- ...ion_GetMeetingParticipantError.test.dialog | 42 -- ...ingParticipantErrorWithAdapter.test.dialog | 43 -- .../ActionTests/Action_GetMember.test.dialog | 65 -- .../Action_GetMemberError.test.dialog | 42 -- ...tion_GetMemberErrorWithAdapter.test.dialog | 43 -- .../Action_GetPagedMembers.test.dialog | 68 -- .../Action_GetPagedMembersError.test.dialog | 42 -- .../Action_GetPagedTeamMembers.test.dialog | 65 -- ...ction_GetPagedTeamMembersError.test.dialog | 42 -- .../Action_GetTeamChannels.test.dialog | 58 -- .../Action_GetTeamChannelsError.test.dialog | 42 -- .../Action_GetTeamDetails.test.dialog | 52 -- .../Action_GetTeamDetailsError.test.dialog | 42 -- .../Action_GetTeamMember.test.dialog | 64 -- .../Action_GetTeamMemberError.test.dialog | 42 -- ..._GetTeamMemberErrorWithAdapter.test.dialog | 43 -- ..._SendAppBasedLinkQueryResponse.test.dialog | 50 -- ...AppBasedLinkQueryResponseError.test.dialog | 79 --- .../Action_SendMEActionResponse.test.dialog | 56 -- ...tion_SendMEActionResponseError.test.dialog | 54 -- ...tion_SendMEAttachmentsResponse.test.dialog | 50 -- ...SendMEAttachmentsResponseError.test.dialog | 44 -- .../Action_SendMEAuthResponse.test.dialog | 41 -- ...Action_SendMEAuthResponseError.test.dialog | 43 -- ...MEAuthResponseErrorWithAdapter.test.dialog | 88 --- ...endMEBotMessagePreviewResponse.test.dialog | 52 -- ...BotMessagePreviewResponseError.test.dialog | 79 --- ...EConfigQuerySettingUrlResponse.test.dialog | 39 -- ...igQuerySettingUrlResponseError.test.dialog | 32 - .../Action_SendMEMessageResponse.test.dialog | 38 -- ...ion_SendMEMessageResponseError.test.dialog | 32 - ...ction_SendMESelectItemResponse.test.dialog | 50 -- ..._SendMESelectItemResponseError.test.dialog | 79 --- ...tion_SendMessageToTeamsChannel.test.dialog | 63 -- ...SendMessageToTeamsChannelError.test.dialog | 37 -- ...ction_SendTabAuthResponseError.test.dialog | 43 -- ...abAuthResponseErrorWithAdapter.test.dialog | 88 --- .../Action_SendTabCardResponse.test.dialog | 66 -- ...ction_SendTabCardResponseError.test.dialog | 79 --- ...ion_SendTaskModuleCardResponse.test.dialog | 56 -- ...endTaskModuleCardResponseError.test.dialog | 79 --- ..._SendTaskModuleMessageResponse.test.dialog | 37 -- ...tion_SendTaskModuleUrlResponse.test.dialog | 47 -- ...SendTaskModuleUrlResponseError.test.dialog | 42 -- ...nalsTests_OnTeamsActivityTypes.test.dialog | 616 ------------------ 52 files changed, 7 insertions(+), 3830 deletions(-) delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/ActionTests.cs delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/ConditionalTests.cs delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Microsoft.Bot.Components.Teams.Tests.csproj delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/ResourceExplorerFixture.cs delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/TestUtils.cs delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMeetingParticipant.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMeetingParticipantError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMeetingParticipantErrorWithAdapter.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMember.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMemberError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMemberErrorWithAdapter.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedMembers.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedMembersError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedTeamMembers.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedTeamMembersError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamChannels.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamChannelsError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamDetails.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamDetailsError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamMember.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamMemberError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamMemberErrorWithAdapter.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendAppBasedLinkQueryResponse.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendAppBasedLinkQueryResponseError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEActionResponse.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEActionResponseError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAttachmentsResponse.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAttachmentsResponseError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAuthResponse.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAuthResponseError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAuthResponseErrorWithAdapter.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEBotMessagePreviewResponse.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEBotMessagePreviewResponseError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponse.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponseError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEMessageResponse.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEMessageResponseError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMESelectItemResponse.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMESelectItemResponseError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMessageToTeamsChannel.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMessageToTeamsChannelError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabAuthResponseError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabAuthResponseErrorWithAdapter.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabCardResponse.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabCardResponseError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleCardResponse.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleCardResponseError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleMessageResponse.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleUrlResponse.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleUrlResponseError.test.dialog delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ConditionalTests/ConditionalsTests_OnTeamsActivityTypes.test.dialog diff --git a/tests/unit/Microsoft.Bot.Components.Tests.sln b/tests/unit/Microsoft.Bot.Components.Tests.sln index 74801b67a6..733f8655f9 100644 --- a/tests/unit/Microsoft.Bot.Components.Tests.sln +++ b/tests/unit/Microsoft.Bot.Components.Tests.sln @@ -17,10 +17,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "packages", "packages", "{73 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "teams", "teams", "{61708441-52A4-48F6-819A-B8D4C279C4C8}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Components.Teams.Tests", "packages\Microsoft.Bot.Components.Teams.Tests\Microsoft.Bot.Components.Teams.Tests.csproj", "{F6E872DE-52B7-4372-B546-B18B5A495C73}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Components.Graph", "..\..\packages\Graph\Microsoft.Bot.Components.Graph.csproj", "{9561BF32-D0EE-464F-981B-7E4298ACDDFB}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bot.Components.Teams.Tests", "packages\Teams\dotnet\Microsoft.Bot.Components.Teams.Tests.csproj", "{4005C95D-BECC-450B-927D-54C8CCF178BB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -43,14 +43,14 @@ Global {F0E73465-DB1D-4F8A-B527-88F1E2515A5C}.Debug|Any CPU.Build.0 = Debug|Any CPU {F0E73465-DB1D-4F8A-B527-88F1E2515A5C}.Release|Any CPU.ActiveCfg = Release|Any CPU {F0E73465-DB1D-4F8A-B527-88F1E2515A5C}.Release|Any CPU.Build.0 = Release|Any CPU - {F6E872DE-52B7-4372-B546-B18B5A495C73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F6E872DE-52B7-4372-B546-B18B5A495C73}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F6E872DE-52B7-4372-B546-B18B5A495C73}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F6E872DE-52B7-4372-B546-B18B5A495C73}.Release|Any CPU.Build.0 = Release|Any CPU {9561BF32-D0EE-464F-981B-7E4298ACDDFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9561BF32-D0EE-464F-981B-7E4298ACDDFB}.Debug|Any CPU.Build.0 = Debug|Any CPU {9561BF32-D0EE-464F-981B-7E4298ACDDFB}.Release|Any CPU.ActiveCfg = Release|Any CPU {9561BF32-D0EE-464F-981B-7E4298ACDDFB}.Release|Any CPU.Build.0 = Release|Any CPU + {4005C95D-BECC-450B-927D-54C8CCF178BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4005C95D-BECC-450B-927D-54C8CCF178BB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4005C95D-BECC-450B-927D-54C8CCF178BB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4005C95D-BECC-450B-927D-54C8CCF178BB}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -60,7 +60,7 @@ Global {6876407A-F34E-479F-9F3C-6E6ED81EB600} = {31CBAEDA-E319-49AE-A662-AA0739205C82} {F0E73465-DB1D-4F8A-B527-88F1E2515A5C} = {31CBAEDA-E319-49AE-A662-AA0739205C82} {61708441-52A4-48F6-819A-B8D4C279C4C8} = {73825711-6685-48E2-BFA2-3FCDECE1A0FD} - {F6E872DE-52B7-4372-B546-B18B5A495C73} = {61708441-52A4-48F6-819A-B8D4C279C4C8} + {4005C95D-BECC-450B-927D-54C8CCF178BB} = {61708441-52A4-48F6-819A-B8D4C279C4C8} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {2D0FB02B-704A-44E0-AECA-A4FDF6F805C5} diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/ActionTests.cs b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/ActionTests.cs deleted file mode 100644 index c4f5ff73f7..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/ActionTests.cs +++ /dev/null @@ -1,592 +0,0 @@ -// 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 deleted file mode 100644 index 8c744a42d9..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/ConditionalTests.cs +++ /dev/null @@ -1,40 +0,0 @@ -// 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 deleted file mode 100644 index ac8cdfb095..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Microsoft.Bot.Components.Teams.Tests.csproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - 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 deleted file mode 100644 index 7b2b192b71..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/ResourceExplorerFixture.cs +++ /dev/null @@ -1,38 +0,0 @@ -// 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 deleted file mode 100644 index f8f136dc1b..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/TestUtils.cs +++ /dev/null @@ -1,98 +0,0 @@ -// 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 deleted file mode 100644 index a770c1cc0c..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMeetingParticipant.test.dialog +++ /dev/null @@ -1,66 +0,0 @@ -{ - "$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 deleted file mode 100644 index e4d8551cdd..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMeetingParticipantError.test.dialog +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$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 deleted file mode 100644 index eab01c2edc..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMeetingParticipantErrorWithAdapter.test.dialog +++ /dev/null @@ -1,43 +0,0 @@ -{ - "$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 deleted file mode 100644 index 90d44b865c..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMember.test.dialog +++ /dev/null @@ -1,65 +0,0 @@ -{ - "$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 deleted file mode 100644 index 03ed714e8c..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMemberError.test.dialog +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$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 deleted file mode 100644 index 70b25fc571..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetMemberErrorWithAdapter.test.dialog +++ /dev/null @@ -1,43 +0,0 @@ -{ - "$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 deleted file mode 100644 index 07dcae5c4f..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedMembers.test.dialog +++ /dev/null @@ -1,68 +0,0 @@ -{ - "$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 deleted file mode 100644 index 2f2f705eb2..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedMembersError.test.dialog +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$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 deleted file mode 100644 index 559b99576c..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedTeamMembers.test.dialog +++ /dev/null @@ -1,65 +0,0 @@ -{ - "$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 deleted file mode 100644 index f8b11b4486..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetPagedTeamMembersError.test.dialog +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$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 deleted file mode 100644 index a5e4697ba9..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamChannels.test.dialog +++ /dev/null @@ -1,58 +0,0 @@ -{ - "$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 deleted file mode 100644 index 7d6735ab0f..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamChannelsError.test.dialog +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$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 deleted file mode 100644 index 49d9f9068e..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamDetails.test.dialog +++ /dev/null @@ -1,52 +0,0 @@ -{ - "$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 deleted file mode 100644 index a501cfdbef..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamDetailsError.test.dialog +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$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 deleted file mode 100644 index 4a45b57cf6..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamMember.test.dialog +++ /dev/null @@ -1,64 +0,0 @@ -{ - "$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 deleted file mode 100644 index 6f97c8bc51..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamMemberError.test.dialog +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$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 deleted file mode 100644 index ad843a82c7..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_GetTeamMemberErrorWithAdapter.test.dialog +++ /dev/null @@ -1,43 +0,0 @@ -{ - "$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 deleted file mode 100644 index 188d548469..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendAppBasedLinkQueryResponse.test.dialog +++ /dev/null @@ -1,50 +0,0 @@ -{ - "$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 deleted file mode 100644 index 2323a1cb05..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendAppBasedLinkQueryResponseError.test.dialog +++ /dev/null @@ -1,79 +0,0 @@ -{ - "$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 deleted file mode 100644 index 4f83b08266..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEActionResponse.test.dialog +++ /dev/null @@ -1,56 +0,0 @@ -{ - "$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 deleted file mode 100644 index 8fd4f9bb21..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEActionResponseError.test.dialog +++ /dev/null @@ -1,54 +0,0 @@ -{ - "$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 deleted file mode 100644 index 5ae8adb325..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAttachmentsResponse.test.dialog +++ /dev/null @@ -1,50 +0,0 @@ -{ - "$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 deleted file mode 100644 index ed4f18b0b0..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAttachmentsResponseError.test.dialog +++ /dev/null @@ -1,44 +0,0 @@ -{ - "$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 deleted file mode 100644 index 6acfa74080..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAuthResponse.test.dialog +++ /dev/null @@ -1,41 +0,0 @@ -{ - "$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 deleted file mode 100644 index b860a92226..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAuthResponseError.test.dialog +++ /dev/null @@ -1,43 +0,0 @@ -{ - "$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 deleted file mode 100644 index 7d7425ba9b..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEAuthResponseErrorWithAdapter.test.dialog +++ /dev/null @@ -1,88 +0,0 @@ -{ - "$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 deleted file mode 100644 index 74343b9138..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEBotMessagePreviewResponse.test.dialog +++ /dev/null @@ -1,52 +0,0 @@ -{ - "$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 deleted file mode 100644 index 3ef5fd3bac..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEBotMessagePreviewResponseError.test.dialog +++ /dev/null @@ -1,79 +0,0 @@ -{ - "$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 deleted file mode 100644 index 65d8447602..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponse.test.dialog +++ /dev/null @@ -1,39 +0,0 @@ -{ - "$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 deleted file mode 100644 index 6245df449d..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponseError.test.dialog +++ /dev/null @@ -1,32 +0,0 @@ -{ - "$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 deleted file mode 100644 index 0efa1dfde0..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEMessageResponse.test.dialog +++ /dev/null @@ -1,38 +0,0 @@ -{ - "$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 deleted file mode 100644 index 6f4f595c4b..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMEMessageResponseError.test.dialog +++ /dev/null @@ -1,32 +0,0 @@ -{ - "$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 deleted file mode 100644 index b9a8f8ddb2..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMESelectItemResponse.test.dialog +++ /dev/null @@ -1,50 +0,0 @@ -{ - "$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 deleted file mode 100644 index a78eb61c61..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMESelectItemResponseError.test.dialog +++ /dev/null @@ -1,79 +0,0 @@ -{ - "$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 deleted file mode 100644 index 6996effedb..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMessageToTeamsChannel.test.dialog +++ /dev/null @@ -1,63 +0,0 @@ -{ - "$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 deleted file mode 100644 index 19419f3b1c..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendMessageToTeamsChannelError.test.dialog +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$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 deleted file mode 100644 index b5e40d7263..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabAuthResponseError.test.dialog +++ /dev/null @@ -1,43 +0,0 @@ -{ - "$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 deleted file mode 100644 index 8172f1d27c..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabAuthResponseErrorWithAdapter.test.dialog +++ /dev/null @@ -1,88 +0,0 @@ -{ - "$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 deleted file mode 100644 index 7e06e3ecde..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabCardResponse.test.dialog +++ /dev/null @@ -1,66 +0,0 @@ -{ - "$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 deleted file mode 100644 index 1e8a6bdc8c..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTabCardResponseError.test.dialog +++ /dev/null @@ -1,79 +0,0 @@ -{ - "$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 deleted file mode 100644 index d3c0c285fd..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleCardResponse.test.dialog +++ /dev/null @@ -1,56 +0,0 @@ -{ - "$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 deleted file mode 100644 index 20e353e108..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleCardResponseError.test.dialog +++ /dev/null @@ -1,79 +0,0 @@ -{ - "$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 deleted file mode 100644 index 5819cd6331..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleMessageResponse.test.dialog +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$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 deleted file mode 100644 index 53a2d07eac..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleUrlResponse.test.dialog +++ /dev/null @@ -1,47 +0,0 @@ -{ - "$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 deleted file mode 100644 index e30217656b..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ActionTests/Action_SendTaskModuleUrlResponseError.test.dialog +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$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 deleted file mode 100644 index ef348c61ac..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Tests/ConditionalTests/ConditionalsTests_OnTeamsActivityTypes.test.dialog +++ /dev/null @@ -1,616 +0,0 @@ -{ - "$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 From 94c48047ab20d10d7d050a3f07a4b5674821e59a Mon Sep 17 00:00:00 2001 From: Michael Richardson Date: Tue, 6 Jul 2021 17:02:33 -0700 Subject: [PATCH 02/10] update for CloudAdapter --- .../js/src/actions/baseAuthResponseDialog.ts | 58 +++++++++++++++---- .../js/src/actions/sendTabCardResponse.ts | 25 ++++---- 2 files changed, 58 insertions(+), 25 deletions(-) diff --git a/packages/Teams/js/src/actions/baseAuthResponseDialog.ts b/packages/Teams/js/src/actions/baseAuthResponseDialog.ts index 9d9a5cfa88..e16eed86f4 100644 --- a/packages/Teams/js/src/actions/baseAuthResponseDialog.ts +++ b/packages/Teams/js/src/actions/baseAuthResponseDialog.ts @@ -2,7 +2,13 @@ // Licensed under the MIT License. import isEmpty from 'lodash/isEmpty'; -import { ActionTypes, Activity, CardAction, TokenResponse } from 'botbuilder'; +import { + ActionTypes, + Activity, + CardAction, + CloudAdapterBase, + TokenResponse, +} from 'botbuilder'; import { BoolExpressionConverter, Expression, @@ -22,6 +28,7 @@ import { BaseTeamsCacheInfoResponseDialog, BaseTeamsCacheInfoResponseDialogConfiguration, } from './baseTeamsCacheInfoResponseDialog'; +import { UserTokenClient } from 'botframework-connector'; export interface BaseAuthResponseDialogConfiguration extends BaseTeamsCacheInfoResponseDialogConfiguration { @@ -98,8 +105,8 @@ export abstract class BaseAuthResponseDialog if (tokenResponse) { // We have the token, so the user is already signed in. // Similar to OAuthInput, just return the token in the property. - if (this.property != null) { - dc.state.setValue(this.property?.getValue(dc.state), tokenResponse); + if (this.property) { + dc.state.setValue(this.property.getValue(dc.state), tokenResponse); } // End the dialog and return the token response. @@ -125,19 +132,32 @@ export abstract class BaseAuthResponseDialog * @param {CardAction} _cardAction CardAction with a valid Sign In Link. * @returns {Partial} Promise representing the InvokeResponse Activity specific to this type of auth dialog. */ - protected createOAuthInvokeResponseActivityFromCardAction( + protected abstract createOAuthInvokeResponseActivityFromCardAction( _dc: DialogContext, _cardAction: CardAction - ): Partial { - throw new Error('NotImplemented'); - } + ): Partial; private async createOAuthInvokeResponseActivityFromTitleAndConnectionName( dc: DialogContext, - title?: string, - connectionName?: string + title: string, + connectionName: string ): Promise> { - // TODO: Switch to using Cloud OAuth after this PR gets merged: https://github.com/microsoft/botbuilder-js/pull/3149 + const userTokenClient = dc.context.turnState.get( + (dc.context.adapter as CloudAdapterBase).UserTokenClientKey + ); + if (userTokenClient) { + const signInResource = await userTokenClient.getSignInResource( + connectionName, + dc.context.activity, + '' + ); + return this.createOAuthInvokeResponseActivityFromTitleAndSignInLink( + dc, + title, + signInResource.signInLink as string + ); + } + if (!testAdapterHasAuthMethods(dc.context.adapter)) { throw new Error('Auth is not supported by the current adapter.'); } else if (!title || !connectionName) { @@ -176,13 +196,27 @@ export abstract class BaseAuthResponseDialog dc: DialogContext, connectionName: string ): Promise { - // TODO: Switch to using Cloud OAuth after this PR gets merged: https://github.com/microsoft/botbuilder-js/pull/3149 + // When the Bot Service Auth flow completes, the action.State will contain a magic code used for verification. + const state = dc.context.activity.value?.state; + + const userTokenClient = dc.context.turnState.get( + (dc.context.adapter as CloudAdapterBase).UserTokenClientKey + ); + if (userTokenClient) { + return userTokenClient.getUserToken( + dc.context.activity.from?.id, + connectionName, + dc.context.activity.channelId, + state + ); + } + if (!testAdapterHasAuthMethods(dc.context.adapter)) { throw new Error('Auth is not supported by the current adapter.'); } // When the Bot Service Auth flow completes, the action.State will contain a magic code used for verification. - const magicCode = !isEmpty(dc.context.activity?.value) + const magicCode = !isEmpty(dc.context.activity.value) ? dc.context.activity.value.state : undefined; diff --git a/packages/Teams/js/src/actions/sendTabCardResponse.ts b/packages/Teams/js/src/actions/sendTabCardResponse.ts index a4f83ba764..641b59365e 100644 --- a/packages/Teams/js/src/actions/sendTabCardResponse.ts +++ b/packages/Teams/js/src/actions/sendTabCardResponse.ts @@ -2,6 +2,7 @@ // Licensed under the MIT License. import { + BoolExpression, BoolExpressionConverter, StringExpressionConverter, } from 'adaptive-expressions'; @@ -16,47 +17,45 @@ import { import { Converter, ConverterFactory, + Dialog, DialogContext, DialogStateManager, DialogTurnResult, TemplateInterface, } from 'botbuilder-dialogs'; import { ActivityTemplateConverter } from 'botbuilder-dialogs-adaptive/lib/converters'; -import { - BaseAuthResponseDialog, - BaseAuthResponseDialogConfiguration, -} from './baseAuthResponseDialog'; -export interface SendTabCardResponseConfiguration - extends BaseAuthResponseDialogConfiguration { +export interface SendTabCardResponseConfiguration extends Dialog { cards?: TemplateInterface; + disabled?: boolean | string | BoolExpression; } /** * Send a Card Tab response to the user. */ -export class SendTabCardResponse - extends BaseAuthResponseDialog - implements BaseAuthResponseDialogConfiguration { +export class SendTabCardResponse extends Dialog { /** * Class identifier. */ public static $kind = 'Teams.SendTabCardResponse'; + /** + * Gets or sets an optional expression which if is true will disable this action. + */ + public disabled?: BoolExpression; + /** * Template for the activity expression containing Adaptive Cards to send. */ public cards?: TemplateInterface; public getConverter( - property: keyof BaseAuthResponseDialogConfiguration | string + property: keyof Dialog | string ): Converter | ConverterFactory { switch (property) { case 'disabled': return new BoolExpressionConverter(); case 'property': - case 'connectionName': - case 'title': return new StringExpressionConverter(); case 'cards': return new ActivityTemplateConverter(); @@ -114,7 +113,7 @@ export class SendTabCardResponse */ protected onComputeId(): string { return `SendTabCardResponse[\ - ${this.title?.toString() ?? ''}\ + ${this.cards?.toString() ?? ''}\ ]`; } From 290fe7f604f44c085cb271d439e91ad4b304613f Mon Sep 17 00:00:00 2001 From: Michael Richardson Date: Wed, 7 Jul 2021 09:28:57 -0700 Subject: [PATCH 03/10] add js test workspace --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 7a69ff9c32..33608161e5 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "packages/*", "packages/*/js", "skills/declarative/*", - "testing/*" + "tests/**/js", + "!tests/functional" ], "scripts": { "lint": "yarn workspaces foreach run lint" From 94a81ca0f6c442279cac7f54c16d405cd34b35b0 Mon Sep 17 00:00:00 2001 From: Michael Richardson Date: Wed, 7 Jul 2021 09:29:02 -0700 Subject: [PATCH 04/10] update packages --- packages/Teams/js/package.json | 28 +- yarn.lock | 597 +++++++++++++++++++++++++++------ 2 files changed, 510 insertions(+), 115 deletions(-) diff --git a/packages/Teams/js/package.json b/packages/Teams/js/package.json index 9e349899ce..cf82e5d4a3 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.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", + "adaptive-expressions": "^4.14.0-rc2", + "botbuilder": "^4.14.0-rc2", + "botbuilder-dialogs": "^4.14.0-rc2", + "botbuilder-dialogs-adaptive": "^4.14.0-preview.rc2", + "botbuilder-dialogs-adaptive-runtime-core": "^4.14.0-preview.rc2", + "botbuilder-dialogs-declarative": "^4.14.0-preview.rc2", + "botbuilder-stdlib": "^4.14.0-internal.rc2", "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.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", + "adaptive-expressions": "4.14.0-rc2", + "botbuilder": "4.14.0-rc2", + "botbuilder-dialogs": "4.14.0-rc2", + "botbuilder-dialogs-adaptive": "4.14.0-preview.rc2", + "botbuilder-dialogs-adaptive-runtime-core": "4.14.0-preview.rc2", + "botbuilder-dialogs-declarative": "4.14.0-preview.rc2", + "botbuilder-stdlib": "4.14.0-internal.rc2", "eslint": "latest", "lodash": "^4.17.21", "rimraf": "^3.0.2", diff --git a/yarn.lock b/yarn.lock index 471dba7c98..cd07d252cd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,6 +5,35 @@ __metadata: version: 4 cacheKey: 7 +"@azure/abort-controller@npm:^1.0.0": + version: 1.0.4 + resolution: "@azure/abort-controller@npm:1.0.4" + dependencies: + tslib: ^2.0.0 + checksum: e772f6c9afd2c448260f08ef796e4ff73348c5dfd100ce557cf73dd08d7664e819f11f8e59c19a76daa46c1b271ce3061db23072c2150b112df655d38e82944b + languageName: node + linkType: hard + +"@azure/cognitiveservices-luis-runtime@npm:2.0.0": + version: 2.0.0 + resolution: "@azure/cognitiveservices-luis-runtime@npm:2.0.0" + dependencies: + "@azure/ms-rest-js": ^1.6.0 + tslib: ^1.9.3 + checksum: 15d51d16a707a29e9e72e74e96a4227f43a76e12e920328a8f5c7ebb41c711ac11a9676035b2410a198ba9f0007521f650ebd0046709677b557755327a41a325 + languageName: node + linkType: hard + +"@azure/core-auth@npm:^1.1.4": + version: 1.3.2 + resolution: "@azure/core-auth@npm:1.3.2" + dependencies: + "@azure/abort-controller": ^1.0.0 + tslib: ^2.2.0 + checksum: 66c7d074b55e15ecf75c2de64841693c680c326c969dd037bc3800674b658ae1d1b717975c543a34de2da1a1eb1410983d7d2f96ad1d26b61f0372d9214feeb7 + languageName: node + linkType: hard + "@azure/ms-rest-js@npm:1.9.1": version: 1.9.1 resolution: "@azure/ms-rest-js@npm:1.9.1" @@ -21,6 +50,22 @@ __metadata: languageName: node linkType: hard +"@azure/ms-rest-js@npm:^1.6.0": + version: 1.11.2 + resolution: "@azure/ms-rest-js@npm:1.11.2" + dependencies: + "@azure/core-auth": ^1.1.4 + axios: ^0.21.1 + form-data: ^2.3.2 + tough-cookie: ^2.4.3 + tslib: ^1.9.2 + tunnel: 0.0.6 + uuid: ^3.2.1 + xml2js: ^0.4.19 + checksum: a96f2f075ecbef968ad85606087ad8a1d40382d4b9581d184049c46027f2d470b6b669d5dfec722545f54b10e75f8d60ea5a950a69393bc8c431ec81dd5f561b + languageName: node + linkType: hard + "@babel/code-frame@npm:7.12.11": version: 7.12.11 resolution: "@babel/code-frame@npm:7.12.11" @@ -91,6 +136,21 @@ __metadata: languageName: unknown linkType: soft +"@microsoft/bot-components-teams-tests@workspace:tests/unit/packages/Teams/js": + version: 0.0.0-use.local + resolution: "@microsoft/bot-components-teams-tests@workspace:tests/unit/packages/Teams/js" + dependencies: + "@microsoft/bot-components-teams": "workspace:packages/Teams/js" + "@types/mocha": ^8.2.2 + botbuilder: rc + botbuilder-dialogs-adaptive-testing: rc + botframework-connector: rc + mocha: ^9.0.2 + nock: ^13.1.1 + ts-node: ^10.0.0 + languageName: unknown + linkType: soft + "@microsoft/bot-components-teams@workspace:packages/Teams/js": version: 0.0.0-use.local resolution: "@microsoft/bot-components-teams@workspace:packages/Teams/js" @@ -99,13 +159,13 @@ __metadata: "@types/lodash": ^4.14.168 "@typescript-eslint/eslint-plugin": latest "@typescript-eslint/parser": latest - 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 + adaptive-expressions: ^4.14.0-rc2 + botbuilder: ^4.14.0-rc2 + botbuilder-dialogs: ^4.14.0-rc2 + botbuilder-dialogs-adaptive: ^4.14.0-preview.rc2 + botbuilder-dialogs-adaptive-runtime-core: ^4.14.0-preview.rc2 + botbuilder-dialogs-declarative: ^4.14.0-preview.rc2 + botbuilder-stdlib: ^4.14.0-internal.rc2 eslint: latest lodash: ^4.17.21 rimraf: ^3.0.2 @@ -467,6 +527,34 @@ __metadata: languageName: node linkType: hard +"@tsconfig/node10@npm:^1.0.7": + version: 1.0.8 + resolution: "@tsconfig/node10@npm:1.0.8" + checksum: 0336493b89fb7c06409a1247a3fb00fac2755f21f3f8ae4b9dd2457859abfc5e8ca42b6d9ca5a279fe81bc70fe1f3450eef61e5dd5a63a7b4a6946ff31874816 + languageName: node + linkType: hard + +"@tsconfig/node12@npm:^1.0.7": + version: 1.0.9 + resolution: "@tsconfig/node12@npm:1.0.9" + checksum: 5532bfb5df47ed3a507da533c731a2fb80ee2e886edadbf20e664dcd3172d5c159577a281d15733b8d0c30bfa4e6b48496bef0704192c085520bc76bb9938068 + languageName: node + linkType: hard + +"@tsconfig/node14@npm:^1.0.0": + version: 1.0.1 + resolution: "@tsconfig/node14@npm:1.0.1" + checksum: d0068287dba46dc98e7d49c229b0fee034fbac2bb4bc2efe12cc67227a1c68ec0728ca1e535dff7f033f7455de6c67e9b8f9d90f4fc3bb07c0d9ac08186fe65c + languageName: node + linkType: hard + +"@tsconfig/node16@npm:^1.0.1": + version: 1.0.1 + resolution: "@tsconfig/node16@npm:1.0.1" + checksum: c389a4a81c291a27b96705de7fbe46d29aa4eb771450a41dfc075d89e1fdd63141898043a0d9f627460a1c409d06635a044dc4b3a4516173769a7d0a1558c51d + languageName: node + linkType: hard + "@tsconfig/recommended@npm:^1.0.1": version: 1.0.1 resolution: "@tsconfig/recommended@npm:1.0.1" @@ -533,9 +621,9 @@ __metadata: linkType: hard "@types/lodash@npm:*": - version: 4.14.170 - resolution: "@types/lodash@npm:4.14.170" - checksum: 5ecc968649e764e3204435ba5125a3645e5e83963069a26b9307791698bf47ed9c2bd0f97488d9537eb4753d4bae596e5fa6187437a5b04bf47aba78fa553d50 + version: 4.14.171 + resolution: "@types/lodash@npm:4.14.171" + checksum: e48668fb030ad7d8c0c7751061bd332ad8704937d976bd4e24fd9e2128f80c17112be11e5c13d39f6a210336dc3549f7fb00eaebb56b94c2bfb89ad64c57d721 languageName: node linkType: hard @@ -560,6 +648,13 @@ __metadata: languageName: node linkType: hard +"@types/mocha@npm:^8.2.2": + version: 8.2.2 + resolution: "@types/mocha@npm:8.2.2" + checksum: 3455211b134b0cfcfc71fee2d4f22a6ac3e313a93bf6c0cd3519c1e85653ffb8c9bb68dcff083b8e9e15b4ea3cb4f50d9916709946c082f072807aeba747575b + languageName: node + linkType: hard + "@types/node@npm:*": version: 14.14.31 resolution: "@types/node@npm:14.14.31" @@ -825,9 +920,9 @@ __metadata: languageName: node linkType: hard -"adaptive-expressions@npm:4.14.0-rc0": - version: 4.14.0-rc0 - resolution: "adaptive-expressions@npm:4.14.0-rc0" +"adaptive-expressions@npm:4.14.0-rc2, adaptive-expressions@npm:^4.14.0-rc2": + version: 4.14.0-rc2 + resolution: "adaptive-expressions@npm:4.14.0-rc2" dependencies: "@microsoft/recognizers-text-data-types-timex-expression": 1.3.0 "@types/atob-lite": ^2.0.0 @@ -849,7 +944,7 @@ __metadata: xml2js: ^0.4.23 xmldom: ^0.5.0 xpath: ^0.0.32 - checksum: efb2c322116fe5385ea7b9daade4656c5569b0bfb63ee15e9d756a73d100ebaba0fbfa342bd1c7091eb82c4092b64cd3730ada9ccb008413cad3c8d91e9d507d + checksum: 97e1680fdc7d71614104bea5ba7a1cd4127967911688f5c287e30511f848f66b996df099412bb89ab668a81544662fa4c7e4c4822a3a512fddfc892715099193 languageName: node linkType: hard @@ -963,7 +1058,7 @@ __metadata: languageName: node linkType: hard -"anymatch@npm:~3.1.1": +"anymatch@npm:~3.1.1, anymatch@npm:~3.1.2": version: 3.1.2 resolution: "anymatch@npm:3.1.2" dependencies: @@ -999,6 +1094,13 @@ __metadata: languageName: node linkType: hard +"arg@npm:^4.1.0": + version: 4.1.3 + resolution: "arg@npm:4.1.3" + checksum: 81b3b40b1529c4fbf75b12f7c3e6fb2dcce9e78072063babc169de9b4f40777788f3d2b04380f659ef676a756e03ccfbfe78adf4477353bda906295fa69dab89 + languageName: node + linkType: hard + "argparse@npm:^1.0.7": version: 1.0.10 resolution: "argparse@npm:1.0.10" @@ -1516,6 +1618,13 @@ __metadata: languageName: node linkType: hard +"bitwise@npm:^2.0.4": + version: 2.1.0 + resolution: "bitwise@npm:2.1.0" + checksum: 51c7ae49c2c109444c6aafaf221b86c8caf10c60c3ac0316b0cb1a76d12c8af383170bec22863bdd378ac05730a145a0026a9ce1fe2ff4925dc75c3288e45011 + languageName: node + linkType: hard + "bl@npm:^4.1.0": version: 4.1.0 resolution: "bl@npm:4.1.0" @@ -1527,119 +1636,159 @@ __metadata: languageName: node linkType: hard -"botbuilder-core@npm:4.14.0-rc0": - version: 4.14.0-rc0 - resolution: "botbuilder-core@npm:4.14.0-rc0" +"botbuilder-ai@npm:4.14.0-rc2": + version: 4.14.0-rc2 + resolution: "botbuilder-ai@npm:4.14.0-rc2" dependencies: - 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 + "@azure/cognitiveservices-luis-runtime": 2.0.0 + "@azure/ms-rest-js": 1.9.1 + adaptive-expressions: 4.14.0-rc2 + botbuilder-core: 4.14.0-rc2 + botbuilder-dialogs: 4.14.0-rc2 + botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview.rc2 + botbuilder-dialogs-declarative: 4.14.0-preview.rc2 + botbuilder-stdlib: 4.14.0-internal.rc2 + lodash: ^4.17.21 + node-fetch: ^2.6.0 + url-parse: ^1.5.1 + zod: ~1.11.17 + checksum: 52ff6eef8570c0ee2354f432663ff045c15ec63a282ed99c962be890a770c5a44397560808a2bf5dc49e8e3bd9720258fc5e8c03a0a1066fe1c215d6cb97a024 + languageName: node + linkType: hard + +"botbuilder-core@npm:4.14.0-rc2": + version: 4.14.0-rc2 + resolution: "botbuilder-core@npm:4.14.0-rc2" + dependencies: + botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview.rc2 + botbuilder-stdlib: 4.14.0-internal.rc2 + botframework-connector: 4.14.0-rc2 + botframework-schema: 4.14.0-rc2 uuid: ^8.3.2 zod: ~1.11.17 - checksum: 5e7aa040d6d0e0f2a130e197e8be4472e3bf33562e10fe0dad2843c67dc7f93f53b793626f371af544429473acd75901c4a413835ab96ec01be6833cb1b73956 + checksum: 6a0a55bb576bdfb60e67d5779e7a663db9c546ef5520d75718e30389ddb0d6291fcdc7e7df104ba0443304b28ffe363d41a31ae961d59447be85328a02285cdf languageName: node linkType: hard -"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" +"botbuilder-dialogs-adaptive-runtime-core@npm:4.14.0-preview.rc2, botbuilder-dialogs-adaptive-runtime-core@npm:^4.14.0-preview.rc2": + version: 4.14.0-preview.rc2 + resolution: "botbuilder-dialogs-adaptive-runtime-core@npm:4.14.0-preview.rc2" dependencies: dependency-graph: ^0.10.0 - checksum: 0e74a0d0264a760f8ede0ce3652589767618df1f0182e4e845661fc69d45db29a573d7ae83c86e5f1162cf70e93743d774f1ec35c7fd3f87a3f5c53451dc9adc + checksum: ae23051cb664122f4f40ab5753a1655f34b6b06596bba25d347b3c877dfc986de5da8c30680946a154afc3925f6c9ab4d4ff286821306e570429380d0839dda8 + languageName: node + linkType: hard + +"botbuilder-dialogs-adaptive-testing@npm:rc": + version: 4.14.0-preview.rc2 + resolution: "botbuilder-dialogs-adaptive-testing@npm:4.14.0-preview.rc2" + dependencies: + adaptive-expressions: 4.14.0-rc2 + bitwise: ^2.0.4 + botbuilder-ai: 4.14.0-rc2 + botbuilder-core: 4.14.0-rc2 + botbuilder-dialogs: 4.14.0-rc2 + botbuilder-dialogs-adaptive: 4.14.0-preview.rc2 + botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview.rc2 + botbuilder-dialogs-declarative: 4.14.0-preview.rc2 + botbuilder-stdlib: 4.14.0-internal.rc2 + murmurhash-js: ^1.0.0 + nock: ^11.9.1 + url-parse: ^1.5.1 + checksum: 1dd15e908939fb7c74a6c3b627f152cdf7fc5420a62580e17962ed39f1d4c7a39d0b00659661f519e4348c4e64ff4064928ecedba0012382b7eb71f2ffdf4ced languageName: node linkType: hard -"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" +"botbuilder-dialogs-adaptive@npm:4.14.0-preview.rc2, botbuilder-dialogs-adaptive@npm:^4.14.0-preview.rc2": + version: 4.14.0-preview.rc2 + resolution: "botbuilder-dialogs-adaptive@npm:4.14.0-preview.rc2" dependencies: "@microsoft/recognizers-text-suite": 1.1.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 + adaptive-expressions: 4.14.0-rc2 + botbuilder: 4.14.0-rc2 + botbuilder-dialogs: 4.14.0-rc2 + botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview.rc2 + botbuilder-dialogs-declarative: 4.14.0-preview.rc2 + botbuilder-lg: 4.14.0-rc2 lodash: ^4.17.21 node-fetch: ^2.6.0 - checksum: 22c93799df01a5620a6188f1be55d99f7dae17f7411846d98ff871cc5e60cbde61054a5f95493f0615d50c21a01f0de591d9ea3487757a382afc5fdc8278a5f6 + checksum: 59ac133abad4fd91cf45b06de5ffc08d9839f2196d393d4f40f9863fb0a731b009bfd8df98985b066ba64e1050745a9422a7bbfbc762eb9e2c200b9ee8b05f3d languageName: node linkType: hard -"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" +"botbuilder-dialogs-declarative@npm:4.14.0-preview.rc2, botbuilder-dialogs-declarative@npm:^4.14.0-preview.rc2": + version: 4.14.0-preview.rc2 + resolution: "botbuilder-dialogs-declarative@npm:4.14.0-preview.rc2" dependencies: - botbuilder-core: 4.14.0-rc0 - botbuilder-dialogs: 4.14.0-rc0 - botbuilder-stdlib: 4.14.0-internal.rc0 + botbuilder-core: 4.14.0-rc2 + botbuilder-dialogs: 4.14.0-rc2 + botbuilder-stdlib: 4.14.0-internal.rc2 chokidar: ^3.4.0 - checksum: 62b8b7e0f52f2be96d221df0254875bf848ae91eb945c81f1c911ea65fd2d76ff51029673347932da77c424d4b205d1050fb975fea8edbb5ad035d818ac1cee7 + checksum: 65c685b15e7a9257bef4a0f8481f274909c10c2db93a2f72040ed66aa1c1e937c07ef389754e37e3f40a08e816eb85a76843c16f39b8dd4f1ae8aae221fec3ec languageName: node linkType: hard -"botbuilder-dialogs@npm:4.14.0-rc0": - version: 4.14.0-rc0 - resolution: "botbuilder-dialogs@npm:4.14.0-rc0" +"botbuilder-dialogs@npm:4.14.0-rc2, botbuilder-dialogs@npm:^4.14.0-rc2": + version: 4.14.0-rc2 + resolution: "botbuilder-dialogs@npm:4.14.0-rc2" 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.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 + botbuilder-core: 4.14.0-rc2 + botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview.rc2 + botbuilder-stdlib: 4.14.0-internal.rc2 + botframework-connector: 4.14.0-rc2 globalize: ^1.4.2 lodash: ^4.17.21 zod: ~1.11.17 - checksum: 77b6161bfc04e1e19ad2b0cd0ec96b073a1f617734f52697a7bb2ad21f470410eedeb54e604a414d997b6747b542a008753553f94e3b517724cbe8575fac68f2 + checksum: 552f8f244a5b3109071d8e930fd24ff08a5063db4d92005350e1e99ddd41a1dd159c6dedd739f9f76653d3b61f00f16e2d67d3c6176bc2a29cd17ce0a36395b8 languageName: node linkType: hard -"botbuilder-lg@npm:4.14.0-rc0": - version: 4.14.0-rc0 - resolution: "botbuilder-lg@npm:4.14.0-rc0" +"botbuilder-lg@npm:4.14.0-rc2": + version: 4.14.0-rc2 + resolution: "botbuilder-lg@npm:4.14.0-rc2" dependencies: - adaptive-expressions: 4.14.0-rc0 + adaptive-expressions: 4.14.0-rc2 antlr4ts: 0.5.0-alpha.3 lodash: ^4.17.19 uuid: ^8.3.2 - checksum: 40e02788ece6eafd553ca2b3bf3d29e9eae71b4c5d3a63e9d8e6b6c83675f37059049c28dee8106659ee5b9e94288148429aad4fad474bc01365c7fc49f6a5ef + checksum: 28f2fd8d6fba0a2feb9887773034a42c4bf730cd4c414a33a5d6bdde795c7a4231a27750e8cdef29a0a5d24b418ce0d9252ebc326e07b337b0181aed9bd0776b languageName: node linkType: hard -"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 +"botbuilder-stdlib@npm:4.14.0-internal.rc2, botbuilder-stdlib@npm:^4.14.0-internal.rc2": + version: 4.14.0-internal.rc2 + resolution: "botbuilder-stdlib@npm:4.14.0-internal.rc2" + checksum: fa437e8cc3d689901ff3a24276e64d7de998a5ce573793b28e026c0dc13631fb391ad7464367049da0e3249bc6a6f0b5a76392c013f351d9b97f6e2454030f07 languageName: node linkType: hard -"botbuilder@npm:4.14.0-rc0": - version: 4.14.0-rc0 - resolution: "botbuilder@npm:4.14.0-rc0" +"botbuilder@npm:4.14.0-rc2, botbuilder@npm:^4.14.0-rc2, botbuilder@npm:rc": + version: 4.14.0-rc2 + resolution: "botbuilder@npm:4.14.0-rc2" dependencies: "@azure/ms-rest-js": 1.9.1 axios: ^0.21.1 - 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 + botbuilder-core: 4.14.0-rc2 + botbuilder-stdlib: 4.14.0-internal.rc2 + botframework-connector: 4.14.0-rc2 + botframework-streaming: 4.14.0-rc2 dayjs: ^1.10.3 filenamify: ^4.1.0 fs-extra: ^7.0.1 htmlparser2: ^6.0.1 uuid: ^8.3.2 zod: ~1.11.17 - checksum: 3d00f49a6dd34fb6bc6a63f5fb42645b5da87b3d2299576331c7a15e3b8e732a196181101fd62d13d7483a3c969b2fd8e3e623f15d4fce337b3ede87c99bec43 + checksum: 324beaa09fb3870a03247f6b76925c05f1c61d7b193184c71f55dcb5abf2f1efe1edebe3da84a0e182af7b3534b6273c4390e89faf282036f7a8e2a5d2dc3a35 languageName: node linkType: hard -"botframework-connector@npm:4.14.0-rc0": - version: 4.14.0-rc0 - resolution: "botframework-connector@npm:4.14.0-rc0" +"botframework-connector@npm:4.14.0-rc2, botframework-connector@npm:rc": + version: 4.14.0-rc2 + resolution: "botframework-connector@npm:4.14.0-rc2" dependencies: "@azure/ms-rest-js": 1.9.1 "@types/jsonwebtoken": 7.2.8 @@ -1647,34 +1796,34 @@ __metadata: adal-node: 0.2.2 axios: ^0.21.1 base64url: ^3.0.0 - botbuilder-stdlib: 4.14.0-internal.rc0 - botframework-schema: 4.14.0-rc0 + botbuilder-stdlib: 4.14.0-internal.rc2 + botframework-schema: 4.14.0-rc2 cross-fetch: ^3.0.5 jsonwebtoken: 8.0.1 rsa-pem-from-mod-exp: ^0.8.4 - checksum: 64331d4b0c62159487aba3dcfef2b5a8225967484e21badf4cc6d3dd3b1a5437863a6b8d90eb777428f4328204d61b28d956260ee5002c89a6cdd7b4a8a84f44 + checksum: 188c646db252281469786ee5964c394897995ef74ca604df14dead099a8681db77c2477e2928f5af5c532e7aba1e0b0ed4c24dfefe34d819f676e9ac6e71120d languageName: node linkType: hard -"botframework-schema@npm:4.14.0-rc0": - version: 4.14.0-rc0 - resolution: "botframework-schema@npm:4.14.0-rc0" +"botframework-schema@npm:4.14.0-rc2": + version: 4.14.0-rc2 + resolution: "botframework-schema@npm:4.14.0-rc2" dependencies: - botbuilder-stdlib: 4.14.0-internal.rc0 + botbuilder-stdlib: 4.14.0-internal.rc2 uuid: ^8.3.2 - checksum: 510bf414ba745f37bc227ca3bd4d15ec1b993effa879cfa92ef960f3c74c74b148463faf64fe5570e4fd70feac17edd128b21fd2245d77d6bfc25f13659c474d + checksum: 580a64fc1ebf6141497ed832025908f29a19b4dfafcb2a4b39897d6e66cab4696f793cb13ce8c0a5ea5138c47ecc9b595f49d6d01dac9159982124e2b7656541 languageName: node linkType: hard -"botframework-streaming@npm:4.14.0-rc0": - version: 4.14.0-rc0 - resolution: "botframework-streaming@npm:4.14.0-rc0" +"botframework-streaming@npm:4.14.0-rc2": + version: 4.14.0-rc2 + resolution: "botframework-streaming@npm:4.14.0-rc2" dependencies: "@types/node": ^10.17.27 "@types/ws": ^6.0.3 uuid: ^8.3.2 ws: ^7.1.2 - checksum: 3da7ae9029e040436d72a8b35ca29baa684608522a221ac81379eac1be1d74f1dedb19fc171cb09f6d75564496fb0e76ea3f67602e7bcf0b83f609809eab9d7c + checksum: e069264b1adb922a3aee3ee3bee3962d46a8db5176a29a5ab121f96b88b9294af59fa1176d10d85f344bc6c5ccac0c01bd29614617e49aa00e2e69a387788e84 languageName: node linkType: hard @@ -1997,6 +2146,25 @@ __metadata: languageName: node linkType: hard +"chokidar@npm:3.5.2": + version: 3.5.2 + resolution: "chokidar@npm:3.5.2" + dependencies: + anymatch: ~3.1.2 + braces: ~3.0.2 + fsevents: ~2.3.2 + glob-parent: ~5.1.2 + is-binary-path: ~2.1.0 + is-glob: ~4.0.1 + normalize-path: ~3.0.0 + readdirp: ~3.6.0 + dependenciesMeta: + fsevents: + optional: true + checksum: 52fbff3acebf06ec0125872110f6c8403e66cd3d613264c83405496e199554d99380342d9b3a7ffd7910c53c5865e242ed7dd72fcb2e883d8e3ad3f3883aee6c + languageName: node + linkType: hard + "chownr@npm:^2.0.0": version: 2.0.0 resolution: "chownr@npm:2.0.0" @@ -2298,6 +2466,13 @@ __metadata: languageName: node linkType: hard +"create-require@npm:^1.1.0": + version: 1.1.1 + resolution: "create-require@npm:1.1.1" + checksum: babd307893abfb26d77ae11cb9d6b6cfa6d18c9cee435cf70b5a3fb44aa8d90c9ec26ea89cbb16e0a94b8d34f5fcaee164b90ed526cdd3158955673ab9652d01 + languageName: node + linkType: hard + "cross-fetch@npm:^3.0.5": version: 3.1.4 resolution: "cross-fetch@npm:3.1.4" @@ -3647,7 +3822,7 @@ fsevents@^1.2.3: languageName: node linkType: hard -"fsevents@patch:fsevents@~2.3.1#builtin": +"fsevents@patch:fsevents@~2.3.1#builtin, fsevents@patch:fsevents@~2.3.2#builtin": version: 2.3.2 resolution: "fsevents@patch:fsevents@npm%3A2.3.2#builtin::version=2.3.2&hash=11e9ea" dependencies: @@ -3656,7 +3831,7 @@ fsevents@^1.2.3: languageName: node linkType: hard -fsevents@~2.3.1: +"fsevents@~2.3.1, fsevents@~2.3.2": version: 2.3.2 resolution: "fsevents@npm:2.3.2" dependencies: @@ -3847,7 +4022,7 @@ fsevents@~2.3.1: languageName: node linkType: hard -"glob-parent@npm:^5.0.0, glob-parent@npm:^5.1.0, glob-parent@npm:~5.1.0": +"glob-parent@npm:^5.0.0, glob-parent@npm:^5.1.0, glob-parent@npm:~5.1.0, glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" dependencies: @@ -3877,6 +4052,20 @@ fsevents@~2.3.1: languageName: node linkType: hard +"glob@npm:7.1.7": + version: 7.1.7 + resolution: "glob@npm:7.1.7" + dependencies: + fs.realpath: ^1.0.0 + inflight: ^1.0.4 + inherits: 2 + minimatch: ^3.0.4 + once: ^1.3.0 + path-is-absolute: ^1.0.0 + checksum: 352f74f08247db5420161a2f68f2bd84b53228b5fcfc9dcc37cd54d3f19ec0232495d84aeff1286d0727059e9fdc1031400e00b971bdc59e30f8f82b199c9d02 + languageName: node + linkType: hard + "globalize@npm:^1.4.2": version: 1.6.0 resolution: "globalize@npm:1.6.0" @@ -5522,6 +5711,17 @@ fsevents@~2.3.1: languageName: node linkType: hard +"js-yaml@npm:4.1.0": + version: 4.1.0 + resolution: "js-yaml@npm:4.1.0" + dependencies: + argparse: ^2.0.1 + bin: + js-yaml: bin/js-yaml.js + checksum: 8973cf4296c944cc2551d1e3d3d064e7de0d0a6db3f7bafe40339ee9e5e0329560b52c4b8492b9b22365404c9be0822b62340ab49884e1dedfcc7ff80158abe0 + languageName: node + linkType: hard + "js-yaml@npm:^3.13.1, js-yaml@npm:^3.7.0": version: 3.14.1 resolution: "js-yaml@npm:3.14.1" @@ -5633,7 +5833,7 @@ fsevents@~2.3.1: languageName: node linkType: hard -"json-stringify-safe@npm:~5.0.1": +"json-stringify-safe@npm:^5.0.1, json-stringify-safe@npm:~5.0.1": version: 5.0.1 resolution: "json-stringify-safe@npm:5.0.1" checksum: 261dfb8eb3e72c8b0dda11fd7c20c151ffc1d1b03e529245d51708c8dd8d8c6a225880464adf41a570dff6e5c805fd9d1f47fed948cfb526e4fbe5a67ce4e5f4 @@ -5978,6 +6178,13 @@ fsevents@~2.3.1: languageName: node linkType: hard +"lodash.set@npm:^4.3.2": + version: 4.3.2 + resolution: "lodash.set@npm:4.3.2" + checksum: 4dfedacae1c1cf86385a2b6e30ba538f06c90d703a0abd83a11432d80ec24b4016fe27359cdc0554a02a31a468789cbb282801dd755e54581cf0295477e2341d + languageName: node + linkType: hard + "lodash.sortby@npm:^4.7.0": version: 4.7.0 resolution: "lodash.sortby@npm:4.7.0" @@ -6006,7 +6213,7 @@ fsevents@~2.3.1: languageName: node linkType: hard -"lodash@npm:^4.17.10, lodash@npm:^4.17.11, lodash@npm:^4.17.14, lodash@npm:^4.17.15, lodash@npm:^4.17.19, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.17.4, lodash@npm:^4.3.0": +"lodash@npm:^4.17.10, lodash@npm:^4.17.11, lodash@npm:^4.17.13, lodash@npm:^4.17.14, lodash@npm:^4.17.15, lodash@npm:^4.17.19, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.17.4, lodash@npm:^4.3.0": version: 4.17.21 resolution: "lodash@npm:4.17.21" checksum: 4983720b9abca930a4a46f18db163d7dad8dd00dbed6db0cc7b499b33b717cce69f80928b27bbb1ff2cbd3b19d251ee90669a8b5ea466072ca81c2ebe91e7468 @@ -6022,16 +6229,7 @@ fsevents@~2.3.1: languageName: node linkType: hard -"log-symbols@npm:^2.2.0": - version: 2.2.0 - resolution: "log-symbols@npm:2.2.0" - dependencies: - chalk: ^2.0.1 - checksum: e2dfd255f3e3080134055597fb67bd67798d65383488683ed90f0376f7264dd21028f30d4c3a0686251dcfc4dc71172e8061cef21e89c6deabb8b375450d5166 - languageName: node - linkType: hard - -"log-symbols@npm:^4.1.0": +"log-symbols@npm:4.1.0, log-symbols@npm:^4.1.0": version: 4.1.0 resolution: "log-symbols@npm:4.1.0" dependencies: @@ -6041,6 +6239,15 @@ fsevents@~2.3.1: languageName: node linkType: hard +"log-symbols@npm:^2.2.0": + version: 2.2.0 + resolution: "log-symbols@npm:2.2.0" + dependencies: + chalk: ^2.0.1 + checksum: e2dfd255f3e3080134055597fb67bd67798d65383488683ed90f0376f7264dd21028f30d4c3a0686251dcfc4dc71172e8061cef21e89c6deabb8b375450d5166 + languageName: node + linkType: hard + "lolex@npm:^2.4.2": version: 2.7.5 resolution: "lolex@npm:2.7.5" @@ -6118,6 +6325,13 @@ fsevents@~2.3.1: languageName: node linkType: hard +"make-error@npm:^1.1.1": + version: 1.3.6 + resolution: "make-error@npm:1.3.6" + checksum: 2c780bab8409b865e8ee86697c599a2bf2765ec64d21eb67ccda27050e039f983feacad05a0d43aba3c966ea03d305d2612e94fec45474bcbc61181f57c5bb88 + languageName: node + linkType: hard + "makeerror@npm:1.0.x": version: 1.0.11 resolution: "makeerror@npm:1.0.11" @@ -6499,6 +6713,42 @@ fsevents@~2.3.1: languageName: node linkType: hard +"mocha@npm:^9.0.2": + version: 9.0.2 + resolution: "mocha@npm:9.0.2" + dependencies: + "@ungap/promise-all-settled": 1.1.2 + ansi-colors: 4.1.1 + browser-stdout: 1.3.1 + chokidar: 3.5.2 + debug: 4.3.1 + diff: 5.0.0 + escape-string-regexp: 4.0.0 + find-up: 5.0.0 + glob: 7.1.7 + growl: 1.10.5 + he: 1.2.0 + js-yaml: 4.1.0 + log-symbols: 4.1.0 + minimatch: 3.0.4 + ms: 2.1.3 + nanoid: 3.1.23 + serialize-javascript: 6.0.0 + strip-json-comments: 3.1.1 + supports-color: 8.1.1 + which: 2.0.2 + wide-align: 1.1.3 + workerpool: 6.1.5 + yargs: 16.2.0 + yargs-parser: 20.2.4 + yargs-unparser: 2.0.0 + bin: + _mocha: bin/_mocha + mocha: bin/mocha + checksum: 305d820f2e7237f54c2c034198978c1ef7c0cf99ddf0c511c8e65e0d7cd00a2b87f7826dc91afa080473152159c1402f419f18d67f831dc55ebc84710ee97823 + languageName: node + linkType: hard + "moment@npm:^2.15.1, moment@npm:^2.24.0": version: 2.29.1 resolution: "moment@npm:2.29.1" @@ -6565,6 +6815,13 @@ fsevents@~2.3.1: languageName: node linkType: hard +"murmurhash-js@npm:^1.0.0": + version: 1.0.0 + resolution: "murmurhash-js@npm:1.0.0" + checksum: 7b0f02796fde7a6fe0e41ed3197b758e6824f33b284a5cbdcca0942e629d34309a4e344760204ad5503dc1d75f9ba7574b72406ac654dc56ab69f22b1e9ee821 + languageName: node + linkType: hard + "mute-stream@npm:0.0.7": version: 0.0.7 resolution: "mute-stream@npm:0.0.7" @@ -6597,6 +6854,15 @@ fsevents@~2.3.1: languageName: node linkType: hard +"nanoid@npm:3.1.23": + version: 3.1.23 + resolution: "nanoid@npm:3.1.23" + bin: + nanoid: bin/nanoid.cjs + checksum: e6dea1da5a593ffdc8cf2676d1d02f0626f07a54a5947a7a1f5ff1fd07901b2f53044c285e98b87eb367f016fde285fd8785d54a2dceeab9c3721f4e618f8326 + languageName: node + linkType: hard + "nanomatch@npm:^1.2.9": version: 1.2.13 resolution: "nanomatch@npm:1.2.13" @@ -6663,6 +6929,31 @@ fsevents@~2.3.1: languageName: node linkType: hard +"nock@npm:^11.9.1": + version: 11.9.1 + resolution: "nock@npm:11.9.1" + dependencies: + debug: ^4.1.0 + json-stringify-safe: ^5.0.1 + lodash: ^4.17.13 + mkdirp: ^0.5.0 + propagate: ^2.0.0 + checksum: 4cbbe7ee50d7a1514c60dfdbd40e10b9ec51035b8f0282dbb1bdd795ae2dd6d8612713b5edcf7fb1034f2d6b4449f672be71880702f1f5d36e06b0e718731ffc + languageName: node + linkType: hard + +"nock@npm:^13.1.1": + version: 13.1.1 + resolution: "nock@npm:13.1.1" + dependencies: + debug: ^4.1.0 + json-stringify-safe: ^5.0.1 + lodash.set: ^4.3.2 + propagate: ^2.0.0 + checksum: fa118c2c62a432b4665fa2a8fe549959ba41666bebf5939873a0fbc3a860310580272de74b3ea9538758a7f08dddd807edf35f162854763a0056f2ed892b210f + languageName: node + linkType: hard + "node-fetch@npm:2.6.1, node-fetch@npm:^2.6.0": version: 2.6.1 resolution: "node-fetch@npm:2.6.1" @@ -7503,6 +7794,13 @@ fsevents@~2.3.1: languageName: node linkType: hard +"propagate@npm:^2.0.0": + version: 2.0.1 + resolution: "propagate@npm:2.0.1" + checksum: dd67518106bb3f1ee230b7e246a18285467e010b89703844f120c38e1462b52d79bddd4be0f8db080377a3d55218209674eae9eb672c29a033bf6b44cfc42828 + languageName: node + linkType: hard + "psl@npm:^1.1.28": version: 1.8.0 resolution: "psl@npm:1.8.0" @@ -7545,6 +7843,13 @@ fsevents@~2.3.1: languageName: node linkType: hard +"querystringify@npm:^2.1.1": + version: 2.2.0 + resolution: "querystringify@npm:2.2.0" + checksum: 6235036be3aedff7919dfc06b23f759264915c5794c6352d52a917401d40d2b9bb43b1d82e4e5be983e469aa320e06992aefc218192f6fa1d9eba4f54dc4786c + languageName: node + linkType: hard + "queue-microtask@npm:^1.2.2": version: 1.2.2 resolution: "queue-microtask@npm:1.2.2" @@ -7715,6 +8020,15 @@ fsevents@~2.3.1: languageName: node linkType: hard +"readdirp@npm:~3.6.0": + version: 3.6.0 + resolution: "readdirp@npm:3.6.0" + dependencies: + picomatch: ^2.2.1 + checksum: 7da2fe8d5abf17ae0bf97a052718e16d29fa185f3e461153035728d93642326ae8e44c17b9a9b3a5fa616dff160e96be3184e0323efaac7211f80c0aab5f622b + languageName: node + linkType: hard + "realpath-native@npm:^1.0.0": version: 1.1.0 resolution: "realpath-native@npm:1.1.0" @@ -7885,6 +8199,13 @@ fsevents@~2.3.1: languageName: node linkType: hard +"requires-port@npm:^1.0.0": + version: 1.0.0 + resolution: "requires-port@npm:1.0.0" + checksum: 0db25fb2ac9b4f2345a350846b7ba99d1f25a6686b1728246d14f05450c8f2fc066bdfae4561b4be2627c184a030a27e17268cfefdf46836e271db13734bc49e + languageName: node + linkType: hard + "resolve-cwd@npm:^2.0.0": version: 2.0.0 resolution: "resolve-cwd@npm:2.0.0" @@ -8189,6 +8510,15 @@ resolve@1.1.7: languageName: node linkType: hard +"serialize-javascript@npm:6.0.0": + version: 6.0.0 + resolution: "serialize-javascript@npm:6.0.0" + dependencies: + randombytes: ^2.1.0 + checksum: e086a40bfcb9d341c37a4e52bc200d143b54397cf1bb486f38cd40cdbaac4b82437d981472df94dbcff6334269e0d82daffbd6b75dd50fe54a5a5da2273f2360 + languageName: node + linkType: hard + "set-blocking@npm:^2.0.0, set-blocking@npm:~2.0.0": version: 2.0.0 resolution: "set-blocking@npm:2.0.0" @@ -8420,7 +8750,7 @@ resolve@1.1.7: languageName: node linkType: hard -"source-map-support@npm:^0.5.6": +"source-map-support@npm:^0.5.17, source-map-support@npm:^0.5.6": version: 0.5.19 resolution: "source-map-support@npm:0.5.19" dependencies: @@ -9004,13 +9334,54 @@ resolve@1.1.7: languageName: node linkType: hard -"tslib@npm:^1.8.1, tslib@npm:^1.9.0, tslib@npm:^1.9.2": +"ts-node@npm:^10.0.0": + version: 10.0.0 + resolution: "ts-node@npm:10.0.0" + dependencies: + "@tsconfig/node10": ^1.0.7 + "@tsconfig/node12": ^1.0.7 + "@tsconfig/node14": ^1.0.0 + "@tsconfig/node16": ^1.0.1 + arg: ^4.1.0 + create-require: ^1.1.0 + diff: ^4.0.1 + make-error: ^1.1.1 + source-map-support: ^0.5.17 + yn: 3.1.1 + peerDependencies: + "@swc/core": ">=1.2.45" + "@swc/wasm": ">=1.2.45" + "@types/node": "*" + typescript: ">=2.7" + peerDependenciesMeta: + "@swc/core": + optional: true + "@swc/wasm": + optional: true + bin: + ts-node: dist/bin.js + ts-node-cwd: dist/bin-cwd.js + ts-node-script: dist/bin-script.js + ts-node-transpile-only: dist/bin-transpile.js + ts-script: dist/bin-script-deprecated.js + checksum: dc461e2b9b931b00ff065530a0247f86da1d035e72a7ef6d7ed072dd8e6b236d1879f113dcc73a354d240c81b6b845445c3d32b16eeb68022ed27ab6d130c049 + languageName: node + linkType: hard + +"tslib@npm:^1.8.1, tslib@npm:^1.9.0, tslib@npm:^1.9.2, tslib@npm:^1.9.3": version: 1.14.1 resolution: "tslib@npm:1.14.1" checksum: f44fe7f216946b17d3e3074df3746372703cf24e9127b4c045511456e8e4bf25515fb0a1bb3937676cc305651c5d4fcb6377b0588a4c6a957e748c4c28905d17 languageName: node linkType: hard +"tslib@npm:^2.0.0, tslib@npm:^2.2.0": + version: 2.3.0 + resolution: "tslib@npm:2.3.0" + checksum: 7b4fc9feff0f704743c3760f5d8d708f6417fac6458159e63df3a6b1100f0736e3b99edb9fe370f274ad15160a1f49ff05cb49402534c818ff552c48e38c3e6e + languageName: node + linkType: hard + "tsutils@npm:^3.17.1": version: 3.21.0 resolution: "tsutils@npm:3.21.0" @@ -9232,6 +9603,16 @@ typescript@^4.0.5: languageName: node linkType: hard +"url-parse@npm:^1.5.1": + version: 1.5.1 + resolution: "url-parse@npm:1.5.1" + dependencies: + querystringify: ^2.1.1 + requires-port: ^1.0.0 + checksum: d8342b597bf1760c4b9e3c78458524d783fa1c901658f3db8b576fc73451c89e6686d218ddca4845b082a63b23971b4a8b916cccc91f4156cc9f97ffdabe0079 + languageName: node + linkType: hard + "url-to-options@npm:^1.0.1": version: 1.0.1 resolution: "url-to-options@npm:1.0.1" @@ -9515,6 +9896,13 @@ typescript@^4.0.5: languageName: node linkType: hard +"workerpool@npm:6.1.5": + version: 6.1.5 + resolution: "workerpool@npm:6.1.5" + checksum: aaf220c463d32c146887d28b45f0291e803c8c41d77a559ff525347f178b3b53b3b029a240bb92529a72771093f7cf5afdc81a28396ecc2f2f3179ad31d03456 + languageName: node + linkType: hard + "wrap-ansi@npm:^2.0.0": version: 2.1.0 resolution: "wrap-ansi@npm:2.1.0" @@ -9917,6 +10305,13 @@ typescript@^4.0.5: languageName: node linkType: hard +"yn@npm:3.1.1": + version: 3.1.1 + resolution: "yn@npm:3.1.1" + checksum: bff63b80568d80c711670935427494dde47cdf97e8b04196b140ce0af519c81c5ee857eddad0caa8b422dd65aea0157bbfaacbb1546bebba623f0f383d5d9ae5 + languageName: node + linkType: hard + "yocto-queue@npm:^0.1.0": version: 0.1.0 resolution: "yocto-queue@npm:0.1.0" From 7afd1b4e9e299320fc178a545b4cb81519af2838 Mon Sep 17 00:00:00 2001 From: Michael Richardson Date: Wed, 7 Jul 2021 09:44:25 -0700 Subject: [PATCH 05/10] un-ignore tests/unit/packages dir --- .gitignore | 3 + .../Action_GetMeetingParticipant.test.dialog | 75 +++ ...ion_GetMeetingParticipantError.test.dialog | 42 ++ ...ingParticipantErrorWithAdapter.test.dialog | 43 ++ .../ActionTests/Action_GetMember.test.dialog | 65 ++ .../Action_GetMemberError.test.dialog | 42 ++ ...tion_GetMemberErrorWithAdapter.test.dialog | 43 ++ .../Action_GetPagedMembers.test.dialog | 68 ++ .../Action_GetPagedMembersError.test.dialog | 42 ++ .../Action_GetPagedTeamMembers.test.dialog | 65 ++ ...ction_GetPagedTeamMembersError.test.dialog | 42 ++ .../Action_GetTeamChannels.test.dialog | 58 ++ .../Action_GetTeamChannelsError.test.dialog | 42 ++ .../Action_GetTeamDetails.test.dialog | 52 ++ .../Action_GetTeamDetailsError.test.dialog | 42 ++ .../Action_GetTeamMember.test.dialog | 64 ++ .../Action_GetTeamMemberError.test.dialog | 42 ++ ..._GetTeamMemberErrorWithAdapter.test.dialog | 43 ++ ..._SendAppBasedLinkQueryResponse.test.dialog | 50 ++ ...AppBasedLinkQueryResponseError.test.dialog | 79 +++ .../Action_SendMEActionResponse.test.dialog | 56 ++ ...tion_SendMEActionResponseError.test.dialog | 54 ++ ...tion_SendMEAttachmentsResponse.test.dialog | 50 ++ ...SendMEAttachmentsResponseError.test.dialog | 44 ++ .../Action_SendMEAuthResponse.test.dialog | 41 ++ ...Action_SendMEAuthResponseError.test.dialog | 43 ++ ...MEAuthResponseErrorWithAdapter.test.dialog | 88 +++ ...endMEBotMessagePreviewResponse.test.dialog | 52 ++ ...BotMessagePreviewResponseError.test.dialog | 79 +++ ...EConfigQuerySettingUrlResponse.test.dialog | 39 ++ ...igQuerySettingUrlResponseError.test.dialog | 32 + .../Action_SendMEMessageResponse.test.dialog | 38 ++ ...ion_SendMEMessageResponseError.test.dialog | 32 + ...ction_SendMESelectItemResponse.test.dialog | 50 ++ ..._SendMESelectItemResponseError.test.dialog | 79 +++ ...tion_SendMessageToTeamsChannel.test.dialog | 63 ++ ...SendMessageToTeamsChannelError.test.dialog | 37 ++ ...ction_SendTabAuthResponseError.test.dialog | 43 ++ ...abAuthResponseErrorWithAdapter.test.dialog | 88 +++ .../Action_SendTabCardResponse.test.dialog | 66 ++ ...ction_SendTabCardResponseError.test.dialog | 79 +++ ...ion_SendTaskModuleCardResponse.test.dialog | 56 ++ ...endTaskModuleCardResponseError.test.dialog | 79 +++ ..._SendTaskModuleMessageResponse.test.dialog | 37 ++ ...tion_SendTaskModuleUrlResponse.test.dialog | 47 ++ ...SendTaskModuleUrlResponseError.test.dialog | 42 ++ ...nalsTests_OnTeamsActivityTypes.test.dialog | 616 ++++++++++++++++++ .../unit/packages/Teams/dotnet/ActionTests.cs | 592 +++++++++++++++++ .../packages/Teams/dotnet/ConditionalTests.cs | 40 ++ ...icrosoft.Bot.Components.Teams.Tests.csproj | 35 + .../Teams/dotnet/ResourceExplorerFixture.cs | 38 ++ tests/unit/packages/Teams/dotnet/TestUtils.cs | 98 +++ tests/unit/packages/Teams/js/package.json | 17 + .../Teams/js/tests/actionTests.test.ts | 493 ++++++++++++++ .../Teams/js/tests/conditionalTests.test.ts | 21 + tests/unit/packages/Teams/js/tests/utils.ts | 41 ++ tests/unit/packages/Teams/js/tsconfig.json | 11 + 57 files changed, 4418 insertions(+) create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipant.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipantError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipantErrorWithAdapter.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMember.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMemberError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMemberErrorWithAdapter.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedMembers.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedMembersError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedTeamMembers.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedTeamMembersError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamChannels.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamChannelsError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamDetails.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamDetailsError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamMember.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamMemberError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamMemberErrorWithAdapter.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendAppBasedLinkQueryResponse.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendAppBasedLinkQueryResponseError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEActionResponse.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEActionResponseError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAttachmentsResponse.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAttachmentsResponseError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAuthResponse.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAuthResponseError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAuthResponseErrorWithAdapter.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEBotMessagePreviewResponse.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEBotMessagePreviewResponseError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponse.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponseError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEMessageResponse.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEMessageResponseError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMESelectItemResponse.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMESelectItemResponseError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMessageToTeamsChannel.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMessageToTeamsChannelError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabAuthResponseError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabAuthResponseErrorWithAdapter.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabCardResponse.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabCardResponseError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleCardResponse.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleCardResponseError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleMessageResponse.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleUrlResponse.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleUrlResponseError.test.dialog create mode 100644 tests/unit/packages/Teams/Shared Tests/ConditionalTests/ConditionalsTests_OnTeamsActivityTypes.test.dialog create mode 100644 tests/unit/packages/Teams/dotnet/ActionTests.cs create mode 100644 tests/unit/packages/Teams/dotnet/ConditionalTests.cs create mode 100644 tests/unit/packages/Teams/dotnet/Microsoft.Bot.Components.Teams.Tests.csproj create mode 100644 tests/unit/packages/Teams/dotnet/ResourceExplorerFixture.cs create mode 100644 tests/unit/packages/Teams/dotnet/TestUtils.cs create mode 100644 tests/unit/packages/Teams/js/package.json create mode 100644 tests/unit/packages/Teams/js/tests/actionTests.test.ts create mode 100644 tests/unit/packages/Teams/js/tests/conditionalTests.test.ts create mode 100644 tests/unit/packages/Teams/js/tests/utils.ts create mode 100644 tests/unit/packages/Teams/js/tsconfig.json diff --git a/.gitignore b/.gitignore index 7f2ab38b1a..1635c14d55 100644 --- a/.gitignore +++ b/.gitignore @@ -384,6 +384,9 @@ experimental/generator-dotnet-yeoman/node_modules # Allow the root-level /packages/ directory or it gets confused with NuGet directories !/[Pp]ackages/* +# Allow the packages directory under tests +!/tests/unit/[Pp]ackages/* + # Ignore correct yarn files (no zero install support) .yarn/* !.yarn/patches diff --git a/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipant.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipant.test.dialog new file mode 100644 index 0000000000..85fe1ad023 --- /dev/null +++ b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipant.test.dialog @@ -0,0 +1,75 @@ +{ + "$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" + } + ] + }, + { + "$kind": "Microsoft.OnError", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "${turn.dialogEvent.value.message}" + } + ] + } + ] + }, + "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/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipantError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipantError.test.dialog new file mode 100644 index 0000000000..e4d8551cdd --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipantErrorWithAdapter.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMeetingParticipantErrorWithAdapter.test.dialog new file mode 100644 index 0000000000..eab01c2edc --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_GetMember.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMember.test.dialog new file mode 100644 index 0000000000..90d44b865c --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_GetMemberError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMemberError.test.dialog new file mode 100644 index 0000000000..03ed714e8c --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_GetMemberErrorWithAdapter.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetMemberErrorWithAdapter.test.dialog new file mode 100644 index 0000000000..70b25fc571 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_GetPagedMembers.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedMembers.test.dialog new file mode 100644 index 0000000000..07dcae5c4f --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_GetPagedMembersError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedMembersError.test.dialog new file mode 100644 index 0000000000..2f2f705eb2 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_GetPagedTeamMembers.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedTeamMembers.test.dialog new file mode 100644 index 0000000000..559b99576c --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_GetPagedTeamMembersError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetPagedTeamMembersError.test.dialog new file mode 100644 index 0000000000..f8b11b4486 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_GetTeamChannels.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamChannels.test.dialog new file mode 100644 index 0000000000..a5e4697ba9 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_GetTeamChannelsError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamChannelsError.test.dialog new file mode 100644 index 0000000000..7d6735ab0f --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_GetTeamDetails.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamDetails.test.dialog new file mode 100644 index 0000000000..49d9f9068e --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_GetTeamDetailsError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamDetailsError.test.dialog new file mode 100644 index 0000000000..a501cfdbef --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_GetTeamMember.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamMember.test.dialog new file mode 100644 index 0000000000..4a45b57cf6 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_GetTeamMemberError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamMemberError.test.dialog new file mode 100644 index 0000000000..6f97c8bc51 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_GetTeamMemberErrorWithAdapter.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_GetTeamMemberErrorWithAdapter.test.dialog new file mode 100644 index 0000000000..ad843a82c7 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendAppBasedLinkQueryResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendAppBasedLinkQueryResponse.test.dialog new file mode 100644 index 0000000000..188d548469 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendAppBasedLinkQueryResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendAppBasedLinkQueryResponseError.test.dialog new file mode 100644 index 0000000000..2323a1cb05 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendMEActionResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEActionResponse.test.dialog new file mode 100644 index 0000000000..4f83b08266 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendMEActionResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEActionResponseError.test.dialog new file mode 100644 index 0000000000..8fd4f9bb21 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendMEAttachmentsResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAttachmentsResponse.test.dialog new file mode 100644 index 0000000000..5ae8adb325 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendMEAttachmentsResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAttachmentsResponseError.test.dialog new file mode 100644 index 0000000000..ed4f18b0b0 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendMEAuthResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAuthResponse.test.dialog new file mode 100644 index 0000000000..6acfa74080 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendMEAuthResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAuthResponseError.test.dialog new file mode 100644 index 0000000000..b860a92226 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendMEAuthResponseErrorWithAdapter.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEAuthResponseErrorWithAdapter.test.dialog new file mode 100644 index 0000000000..7d7425ba9b --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendMEBotMessagePreviewResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEBotMessagePreviewResponse.test.dialog new file mode 100644 index 0000000000..74343b9138 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendMEBotMessagePreviewResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEBotMessagePreviewResponseError.test.dialog new file mode 100644 index 0000000000..3ef5fd3bac --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponse.test.dialog new file mode 100644 index 0000000000..65d8447602 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEConfigQuerySettingUrlResponseError.test.dialog new file mode 100644 index 0000000000..6245df449d --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendMEMessageResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEMessageResponse.test.dialog new file mode 100644 index 0000000000..0efa1dfde0 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendMEMessageResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMEMessageResponseError.test.dialog new file mode 100644 index 0000000000..6f4f595c4b --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendMESelectItemResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMESelectItemResponse.test.dialog new file mode 100644 index 0000000000..b9a8f8ddb2 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendMESelectItemResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMESelectItemResponseError.test.dialog new file mode 100644 index 0000000000..a78eb61c61 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendMessageToTeamsChannel.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMessageToTeamsChannel.test.dialog new file mode 100644 index 0000000000..6996effedb --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendMessageToTeamsChannelError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendMessageToTeamsChannelError.test.dialog new file mode 100644 index 0000000000..19419f3b1c --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendTabAuthResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabAuthResponseError.test.dialog new file mode 100644 index 0000000000..b5e40d7263 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendTabAuthResponseErrorWithAdapter.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabAuthResponseErrorWithAdapter.test.dialog new file mode 100644 index 0000000000..8172f1d27c --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendTabCardResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabCardResponse.test.dialog new file mode 100644 index 0000000000..7e06e3ecde --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendTabCardResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTabCardResponseError.test.dialog new file mode 100644 index 0000000000..1e8a6bdc8c --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendTaskModuleCardResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleCardResponse.test.dialog new file mode 100644 index 0000000000..d3c0c285fd --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendTaskModuleCardResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleCardResponseError.test.dialog new file mode 100644 index 0000000000..20e353e108 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendTaskModuleMessageResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleMessageResponse.test.dialog new file mode 100644 index 0000000000..5819cd6331 --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendTaskModuleUrlResponse.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleUrlResponse.test.dialog new file mode 100644 index 0000000000..53a2d07eac --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ActionTests/Action_SendTaskModuleUrlResponseError.test.dialog b/tests/unit/packages/Teams/Shared Tests/ActionTests/Action_SendTaskModuleUrlResponseError.test.dialog new file mode 100644 index 0000000000..e30217656b --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/Teams/Shared Tests/ConditionalTests/ConditionalsTests_OnTeamsActivityTypes.test.dialog b/tests/unit/packages/Teams/Shared Tests/ConditionalTests/ConditionalsTests_OnTeamsActivityTypes.test.dialog new file mode 100644 index 0000000000..ef348c61ac --- /dev/null +++ b/tests/unit/packages/Teams/Shared 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/packages/Teams/dotnet/ActionTests.cs b/tests/unit/packages/Teams/dotnet/ActionTests.cs new file mode 100644 index 0000000000..c4f5ff73f7 --- /dev/null +++ b/tests/unit/packages/Teams/dotnet/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/Teams/dotnet/ConditionalTests.cs b/tests/unit/packages/Teams/dotnet/ConditionalTests.cs new file mode 100644 index 0000000000..d9a73bdc63 --- /dev/null +++ b/tests/unit/packages/Teams/dotnet/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(), "..", "Shared 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/Teams/dotnet/Microsoft.Bot.Components.Teams.Tests.csproj b/tests/unit/packages/Teams/dotnet/Microsoft.Bot.Components.Teams.Tests.csproj new file mode 100644 index 0000000000..8418703494 --- /dev/null +++ b/tests/unit/packages/Teams/dotnet/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/Teams/dotnet/ResourceExplorerFixture.cs b/tests/unit/packages/Teams/dotnet/ResourceExplorerFixture.cs new file mode 100644 index 0000000000..1da40ac30a --- /dev/null +++ b/tests/unit/packages/Teams/dotnet/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(), "..", "Shared Tests", resourceFolder); + ResourceExplorer = ResourceExplorer.AddFolder(_folderPath, monitorChanges: false); + } + + return this; + } + + public void Dispose() + { + _folderPath = string.Empty; + ResourceExplorer.Dispose(); + } + } +} diff --git a/tests/unit/packages/Teams/dotnet/TestUtils.cs b/tests/unit/packages/Teams/dotnet/TestUtils.cs new file mode 100644 index 0000000000..f8f136dc1b --- /dev/null +++ b/tests/unit/packages/Teams/dotnet/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/Teams/js/package.json b/tests/unit/packages/Teams/js/package.json new file mode 100644 index 0000000000..551a69d9ff --- /dev/null +++ b/tests/unit/packages/Teams/js/package.json @@ -0,0 +1,17 @@ +{ + "name": "@microsoft/bot-components-teams-tests", + "private": true, + "scripts": { + "test": "mocha --require ts-node/register tests/*.test.ts" + }, + "dependencies": { + "@microsoft/bot-components-teams": "workspace:packages/Teams/js", + "@types/mocha": "^8.2.2", + "botbuilder": "rc", + "botbuilder-dialogs-adaptive-testing": "rc", + "botframework-connector": "rc", + "mocha": "^9.0.2", + "nock": "^13.1.1", + "ts-node": "^10.0.0" + } +} diff --git a/tests/unit/packages/Teams/js/tests/actionTests.test.ts b/tests/unit/packages/Teams/js/tests/actionTests.test.ts new file mode 100644 index 0000000000..0693de73c8 --- /dev/null +++ b/tests/unit/packages/Teams/js/tests/actionTests.test.ts @@ -0,0 +1,493 @@ +// Licensed under the MIT License. +// Copyright (c) Microsoft Corporation. All rights reserved. + +import { + ConversationState, + useBotState, + MemoryStorage, + UserState, + Channels, + ConversationReference, + ChannelAccount, + ConversationAccount, + BotAdapter, + TestAdapter, +} from 'botbuilder'; +import { AdaptiveTeamsBotComponent } from '@microsoft/bot-components-teams'; +import { TestUtils } from 'botbuilder-dialogs-adaptive-testing'; +import { + ConnectorClient, + MicrosoftAppCredentials, +} from 'botframework-connector'; +import { ok } from 'assert'; +import nock = require('nock'); +import { makeResourceExplorer } from './utils'; + +const getTeamsTestAdapter = ( + convo?: Partial +): TestAdapter => { + const adapter = new TestAdapter(convo as ConversationReference); + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore: This is required because TeamsInfo checks that the adapter has a createConnectorClient method + // and TestAdapter doesn't have one, natively. + adapter.createConnectorClient = () => { + return new ConnectorClient(new MicrosoftAppCredentials('', '')); + }; + + // DialogManager requires conversationState + const storage = new MemoryStorage(); + const userState = new UserState(storage); + const conversationState = new ConversationState(storage); + useBotState((adapter as unknown) as BotAdapter, userState, conversationState); + + return adapter; +}; + +const getTeamsUser = (): ChannelAccount => { + return { + id: '29:User-Id', + name: 'User Name', + aadObjectId: 'participant-aad-id', + }; +}; + +const getPersonalConversation = (): ConversationAccount => { + return { + id: 'a:oneOnOneConversationId', + name: 'oneOnOne', + tenantId: 'tenantId-Guid', + conversationType: 'personal', + isGroup: false, + }; +}; + +const getGroupConversation = (): ConversationAccount => { + return { + id: '19:groupChatId@thread.v2', + name: 'group', + tenantId: 'tenantId-Guid', + conversationType: 'groupChat', + isGroup: true, + }; +}; + +const getBaseConversationReference = (): ConversationReference => { + return { + user: getTeamsUser(), + channelId: Channels.Msteams, + conversation: getPersonalConversation(), + bot: { + id: 'botId', + name: 'Bot', + }, + serviceUrl: 'https://api.botframework.com', + }; +}; + +const getPersonalConversationReference = (): ConversationReference => { + return { + ...getBaseConversationReference(), + conversation: getPersonalConversation(), + }; +}; + +const getGroupConversationReference = (): ConversationReference => { + return { + ...getBaseConversationReference(), + conversation: getGroupConversation(), + }; +}; + +const generateTeamMembers = (amount: number): Record[] => { + const members = []; + const baseUser = getTeamsUser(); + for (let i = 0; i < amount; i++) { + members.push({ + id: `${baseUser.id}-${i}`, + name: `${baseUser.name}-${i}`, + objectId: `User-${i}-Object-Id`, + givenName: 'User', + surname: `Surname-${i}`, + email: `User.${i}@microsoft.com`, + userPrincipalName: `user${i}@microsoft.com`, + tenantId: 'tenant-id-1', + }); + } + + return members; +}; + +describe('Actions', function () { + before(() => nock.disableNetConnect()); + beforeEach(() => nock.cleanAll()); + after(() => nock.enableNetConnect()); + afterEach(() => nock.cleanAll()); + + const resourceExplorer = makeResourceExplorer( + 'ActionTests', + AdaptiveTeamsBotComponent + ); + + /** + * Note: With mocha, `this.test?.title` refers to the test's name, so runTestScript + * is just calling a file with the same name as the test. + */ + it('Action_GetMeetingParticipant', async function () { + const conversationReference = getPersonalConversationReference(); + const participant = { + user: { + userPrincipalName: 'userPrincipalName-1', + }, + meeting: { + role: 'Organizer', + }, + conversation: conversationReference.conversation, + }; + + const fetchExpectation = nock('https://api.botframework.com') + .get( + '/v1/meetings/meeting-id-1/participants/participant-aad-id-1?tenantId=tenant-id-1' + ) + .reply(200, participant); + + const fetchExpectationCustomProperties = nock( + 'https://api.botframework.com' + ) + .get( + '/v1/meetings/customMeetingId/participants/customParticipantId?tenantId=customTenantId' + ) + .reply(200, participant); + + const adapter = getTeamsTestAdapter(conversationReference); + + await TestUtils.runTestScript(resourceExplorer, this.test?.title, adapter); + + ok(fetchExpectation.isDone()); + ok(fetchExpectationCustomProperties.isDone()); + }); + + it('Action_GetMeetingParticipantError', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_GetMeetingParticipantErrorWithAdapter', async function () { + const conversationReference = getPersonalConversationReference(); + const adapter = getTeamsTestAdapter(conversationReference); + + await TestUtils.runTestScript(resourceExplorer, this.test?.title, adapter); + }); + + it('Action_GetMember', async function () { + const conversationReference = getPersonalConversationReference(); + const members = generateTeamMembers(1); + + const fetchExpectation = nock('https://api.botframework.com') + .get('/v3/conversations/a%3AoneOnOneConversationId/members/member-id') + .reply(200, members[0]); + + const fetchExpectationCustomProperties = nock( + 'https://api.botframework.com' + ) + .get( + '/v3/conversations/a%3AoneOnOneConversationId/members/customMemberId' + ) + .reply(200, members[0]); + + const adapter = getTeamsTestAdapter(conversationReference); + + await TestUtils.runTestScript(resourceExplorer, this.test?.title, adapter); + + ok(fetchExpectation.isDone()); + ok(fetchExpectationCustomProperties.isDone()); + }); + + it('Action_GetMemberError', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_GetMemberErrorWithAdapter', async function () { + const conversationReference = getPersonalConversationReference(); + const adapter = getTeamsTestAdapter(conversationReference); + + await TestUtils.runTestScript(resourceExplorer, this.test?.title, adapter); + }); + + it('Action_GetPagedMembers', async function () { + const conversationReference = getGroupConversationReference(); + const members = generateTeamMembers(3); + + const fetchExpectation = nock('https://api.botframework.com') + .get('/v3/conversations/19%3AgroupChatId%40thread.v2/pagedmembers') + .reply(200, { continuationToken: 'token', members }); + + const fetchExpectationCustomProperties = nock( + 'https://api.botframework.com' + ) + .get( + '/v3/conversations/19%3AgroupChatId%40thread.v2/pagedmembers?pageSize=2&continuationToken=token' + ) + .reply(200, { + continuationToken: 'customToken', + members: members.slice(0, 2), + }); + + const adapter = getTeamsTestAdapter(conversationReference); + + await TestUtils.runTestScript(resourceExplorer, this.test?.title, adapter); + + ok(fetchExpectation.isDone()); + ok(fetchExpectationCustomProperties.isDone()); + }); + + it('Action_GetPagedMembersError', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_GetPagedTeamMembers', async function () { + const conversationReference = getGroupConversationReference(); + const members = generateTeamMembers(3); + + const fetchExpectation = nock('https://api.botframework.com') + .get('/v3/conversations/team-id-1/pagedmembers') + .reply(200, { continuationToken: 'token', members }); + + const fetchExpectationCustomProperties = nock( + 'https://api.botframework.com' + ) + .get( + '/v3/conversations/team-id-1/pagedmembers?pageSize=2&continuationToken=token' + ) + .reply(200, { + continuationToken: 'customToken', + members: members.slice(0, 2), + }); + + const adapter = getTeamsTestAdapter(conversationReference); + + await TestUtils.runTestScript(resourceExplorer, this.test?.title, adapter); + + ok(fetchExpectation.isDone()); + ok(fetchExpectationCustomProperties.isDone()); + }); + + it('Action_GetPagedTeamMembersError', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_GetTeamChannels', async function () { + const conversationReference = getGroupConversationReference(); + const conversations = [ + { + id: '19:ChannelIdgeneralChannelId@thread.skype', + name: 'Testing0', + }, + { + id: '19:somechannelId2e5ab3df9ae9b594bdb@thread.skype', + name: 'Testing1', + }, + { + id: '19:somechannelId388ade16aa4dd375e69@thread.skype', + name: 'Testing2', + }, + ]; + + const fetchExpectation = nock('https://api.botframework.com') + .get('/v3/teams/team-id-1/conversations') + .reply(200, { conversations }); + + const fetchExpectationCustomProperties = nock( + 'https://api.botframework.com' + ) + .get('/v3/teams/customTeamId/conversations') + .reply(200, { conversations }); + + const adapter = getTeamsTestAdapter(conversationReference); + + await TestUtils.runTestScript(resourceExplorer, this.test?.title, adapter); + + ok(fetchExpectation.isDone()); + ok(fetchExpectationCustomProperties.isDone()); + }); + + it('Action_GetTeamChannelsError', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_GetTeamDetails', async function () { + const conversationReference = getGroupConversationReference(); + const teamDetails = { + id: '19:generalChannelIdgeneralChannelId@thread.skype', + name: 'TeamName', + aadGroupId: 'Team-aadGroupId', + }; + + const fetchExpectation = nock('https://api.botframework.com') + .get('/v3/teams/team-id-1') + .reply(200, teamDetails); + + const fetchExpectationCustomProperties = nock( + 'https://api.botframework.com' + ) + .get('/v3/teams/customTeamId') + .reply(200, teamDetails); + + const adapter = getTeamsTestAdapter(conversationReference); + + await TestUtils.runTestScript(resourceExplorer, this.test?.title, adapter); + + ok(fetchExpectation.isDone()); + ok(fetchExpectationCustomProperties.isDone()); + }); + + it('Action_GetTeamDetailsError', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_GetTeamMember', async function () { + const conversationReference = getGroupConversationReference(); + const members = generateTeamMembers(1); + + const fetchExpectation = nock('https://api.botframework.com') + .get('/v3/conversations/team-id-1/members/29%3AUser-Id') + .reply(200, members[0]); + + const fetchExpectationCustomProperties = nock( + 'https://api.botframework.com' + ) + .get('/v3/conversations/customTeamId/members/customMemberId') + .reply(200, members[0]); + + const adapter = getTeamsTestAdapter(conversationReference); + + await TestUtils.runTestScript(resourceExplorer, this.test?.title, adapter); + + ok(fetchExpectation.isDone()); + ok(fetchExpectationCustomProperties.isDone()); + }); + + it('Action_GetTeamMemberError', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_GetTeamMemberErrorWithAdapter', async function () { + const conversationReference = getGroupConversationReference(); + const adapter = getTeamsTestAdapter(conversationReference); + + await TestUtils.runTestScript(resourceExplorer, this.test?.title, adapter); + }); + + it('Action_SendAppBasedLinkQueryResponse', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendAppBasedLinkQueryResponseError', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendMessageToTeamsChannel', async function () { + const conversationReference = getGroupConversationReference(); + const adapter = getTeamsTestAdapter(conversationReference); + + const fetchExpectation = nock('https://api.botframework.com') + .post('/v3/conversations') + .times(2) + .reply(200); + + await TestUtils.runTestScript(resourceExplorer, this.test?.title, adapter); + + ok(fetchExpectation.isDone()); + }); + + it('Action_SendMessageToTeamsChannelError', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendMEActionResponse', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendMEActionResponseError', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendMEAttachmentsResponse', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendMEAttachmentsResponseError', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendMEAuthResponse', async function () { + // Note: the test.dialog for this test uses `StartsWith` at the end due to differences in JS and .NET TestAdapter.getSignInlink + const conversationReference = getPersonalConversationReference(); + conversationReference.conversation.id = 'Action_SendMEAuthResponse'; + const adapter = getTeamsTestAdapter(conversationReference); + + await TestUtils.runTestScript(resourceExplorer, this.test?.title, adapter); + }); + + it('Action_SendMEAuthResponseError', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendMEAuthResponseErrorWithAdapter', async function () { + const adapter = getTeamsTestAdapter(); + // eslint-disable-next-line + // @ts-ignore: We have to set this to null to test the error but tsconfig "strict" doesn't allow it. + adapter.getUserToken = null; + await TestUtils.runTestScript(resourceExplorer, this.test?.title, adapter); + }); + + it('Action_SendMEBotMessagePreviewResponse', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendMEBotMessagePreviewResponseError', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendMEConfigQuerySettingUrlResponse', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendMEConfigQuerySettingUrlResponseError', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendMEMessageResponse', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendMEMessageResponseError', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendMESelectItemResponse', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendMESelectItemResponseError', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendTaskModuleCardResponse', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendTaskModuleCardResponseError', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendTaskModuleMessageResponse', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendTaskModuleUrlResponse', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); + + it('Action_SendTaskModuleUrlResponseError', async function () { + await TestUtils.runTestScript(resourceExplorer, this.test?.title); + }); +}); diff --git a/tests/unit/packages/Teams/js/tests/conditionalTests.test.ts b/tests/unit/packages/Teams/js/tests/conditionalTests.test.ts new file mode 100644 index 0000000000..9c6a66b6ef --- /dev/null +++ b/tests/unit/packages/Teams/js/tests/conditionalTests.test.ts @@ -0,0 +1,21 @@ +// Licensed under the MIT License. +// Copyright (c) Microsoft Corporation. All rights reserved. + +import { TestUtils } from 'botbuilder-dialogs-adaptive-testing'; +import 'mocha'; +import { AdaptiveTeamsBotComponent } from '@microsoft/bot-components-teams'; +import { makeResourceExplorer } from './utils'; + +describe('Conditional Tests', function () { + const resourceExplorer = makeResourceExplorer( + 'ConditionalTests', + AdaptiveTeamsBotComponent + ); + + it('OnTeamsActivityTypes', async () => { + await TestUtils.runTestScript( + resourceExplorer, + 'ConditionalsTests_OnTeamsActivityTypes' + ); + }); +}); diff --git a/tests/unit/packages/Teams/js/tests/utils.ts b/tests/unit/packages/Teams/js/tests/utils.ts new file mode 100644 index 0000000000..72e3263717 --- /dev/null +++ b/tests/unit/packages/Teams/js/tests/utils.ts @@ -0,0 +1,41 @@ +// Licensed under the MIT License. +// Copyright (c) Microsoft Corporation. All rights reserved. + +import { AdaptiveBotComponent } from 'botbuilder-dialogs-adaptive'; +import { + ServiceCollection, + noOpConfiguration, +} from 'botbuilder-dialogs-adaptive-runtime-core'; +import { AdaptiveTestBotComponent } from 'botbuilder-dialogs-adaptive-testing'; +import { + ResourceExplorer, + ResourceExplorerOptions, +} from 'botbuilder-dialogs-declarative'; +import { AdaptiveTeamsBotComponent } from '@microsoft/bot-components-teams'; +import path from 'path'; + +export function makeResourceExplorer( + resourceFolder: string, + ...botComponents: typeof AdaptiveTeamsBotComponent[] +): ResourceExplorer { + const services = new ServiceCollection({ + declarativeTypes: [], + }); + + new AdaptiveBotComponent().configureServices(services, noOpConfiguration); + new AdaptiveTestBotComponent().configureServices(services, noOpConfiguration); + + botComponents.forEach((BotComponent) => { + new BotComponent().configureServices(services, noOpConfiguration); + }); + + const declarativeTypes = services.mustMakeInstance('declarativeTypes'); + + return new ResourceExplorer({ + declarativeTypes, + } as ResourceExplorerOptions).addFolder( + path.join(__dirname, '..', '..', 'Shared Tests', resourceFolder), + true, + false + ); +} diff --git a/tests/unit/packages/Teams/js/tsconfig.json b/tests/unit/packages/Teams/js/tsconfig.json new file mode 100644 index 0000000000..c50e216b32 --- /dev/null +++ b/tests/unit/packages/Teams/js/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "@tsconfig/recommended", + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "composite": true, + "outDir": "lib", + "sourceMap": true, + "strict": true + } + } + \ No newline at end of file From 2ac76b8b146d77db91950ed24dd86f3f8ff3d1c8 Mon Sep 17 00:00:00 2001 From: Michael Richardson Date: Wed, 7 Jul 2021 09:49:10 -0700 Subject: [PATCH 06/10] lint --- tests/unit/packages/Teams/js/package.json | 3 ++- tests/unit/packages/Teams/js/tsconfig.json | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/packages/Teams/js/package.json b/tests/unit/packages/Teams/js/package.json index 551a69d9ff..0779c3c1fc 100644 --- a/tests/unit/packages/Teams/js/package.json +++ b/tests/unit/packages/Teams/js/package.json @@ -2,7 +2,8 @@ "name": "@microsoft/bot-components-teams-tests", "private": true, "scripts": { - "test": "mocha --require ts-node/register tests/*.test.ts" + "test": "mocha --require ts-node/register tests/*.test.ts", + "lint": "eslint . --ext .js,.ts --config ../../../../../packages/Teams/js/.eslintrc.json" }, "dependencies": { "@microsoft/bot-components-teams": "workspace:packages/Teams/js", diff --git a/tests/unit/packages/Teams/js/tsconfig.json b/tests/unit/packages/Teams/js/tsconfig.json index c50e216b32..fe0f8351e4 100644 --- a/tests/unit/packages/Teams/js/tsconfig.json +++ b/tests/unit/packages/Teams/js/tsconfig.json @@ -3,7 +3,6 @@ "compilerOptions": { "allowSyntheticDefaultImports": true, "composite": true, - "outDir": "lib", "sourceMap": true, "strict": true } From 5473022039de2ace5334c28f63ca53a52e4cca26 Mon Sep 17 00:00:00 2001 From: Michael Richardson Date: Wed, 7 Jul 2021 11:20:54 -0700 Subject: [PATCH 07/10] fix: Send message to teams channel support both adapters --- packages/Teams/js/package.json | 16 ++-- .../Teams/js/src/actions/actionHelpers.ts | 23 ++++++ .../src/actions/sendMessageToTeamsChannel.ts | 76 +++++++++++++++++-- .../Teams/js/tests/actionTests.test.ts | 15 ++++ yarn.lock | 44 ++++++----- 5 files changed, 139 insertions(+), 35 deletions(-) diff --git a/packages/Teams/js/package.json b/packages/Teams/js/package.json index cf82e5d4a3..fc47a01a55 100644 --- a/packages/Teams/js/package.json +++ b/packages/Teams/js/package.json @@ -29,13 +29,14 @@ "main": "lib/index.js", "types": "lib/index.d.ts", "peerDependencies": { - "adaptive-expressions": "^4.14.0-rc2", - "botbuilder": "^4.14.0-rc2", - "botbuilder-dialogs": "^4.14.0-rc2", - "botbuilder-dialogs-adaptive": "^4.14.0-preview.rc2", - "botbuilder-dialogs-adaptive-runtime-core": "^4.14.0-preview.rc2", - "botbuilder-dialogs-declarative": "^4.14.0-preview.rc2", - "botbuilder-stdlib": "^4.14.0-internal.rc2", + "adaptive-expressions": "~4.14.0-rc2", + "botbuilder": "~4.14.0-rc2", + "botbuilder-dialogs": "~4.14.0-rc2", + "botbuilder-dialogs-adaptive": "~4.14.0-preview.rc2", + "botbuilder-dialogs-adaptive-runtime-core": "~4.14.0-preview.rc2", + "botbuilder-dialogs-declarative": "~4.14.0-preview.rc2", + "botbuilder-stdlib": "~4.14.0-internal.rc2", + "botframework-connector": "~4.14.0-rc2", "lodash": "^4.17.21" }, "devDependencies": { @@ -50,6 +51,7 @@ "botbuilder-dialogs-adaptive-runtime-core": "4.14.0-preview.rc2", "botbuilder-dialogs-declarative": "4.14.0-preview.rc2", "botbuilder-stdlib": "4.14.0-internal.rc2", + "botframework-connector": "4.14.0-rc2", "eslint": "latest", "lodash": "^4.17.21", "rimraf": "^3.0.2", diff --git a/packages/Teams/js/src/actions/actionHelpers.ts b/packages/Teams/js/src/actions/actionHelpers.ts index 60e118e449..66d1cec41c 100644 --- a/packages/Teams/js/src/actions/actionHelpers.ts +++ b/packages/Teams/js/src/actions/actionHelpers.ts @@ -55,3 +55,26 @@ export const testAdapterHasAuthMethods: Test = ( tests.isFunc((val as BotFrameworkAdapter).getSignInLink)) ); }; + +/** + * This is similar to HasAuthMethods, but purely for testing since TestAdapter does not have + * createConnectorClient, but BotFrameworkAdapter does. + */ +export interface HasCreateConnectorClientMethod { + createConnectorClient: typeof BotFrameworkAdapter.prototype.createConnectorClient; +} + +/** + * Test to assert val has required createConnectorClient method. + * + * @param {any} val Usually context.adapter. + * @returns {Assertion} Asserts that val has required createConnectorClient method. + */ +export const testAdapterHasCreateConnectorClientMethod: Test = ( + val: unknown +): val is HasCreateConnectorClientMethod => { + return ( + val instanceof BotFrameworkAdapter || + tests.isFunc((val as BotFrameworkAdapter).createConnectorClient) + ); +}; diff --git a/packages/Teams/js/src/actions/sendMessageToTeamsChannel.ts b/packages/Teams/js/src/actions/sendMessageToTeamsChannel.ts index 6f0546054b..54d6a17cbc 100644 --- a/packages/Teams/js/src/actions/sendMessageToTeamsChannel.ts +++ b/packages/Teams/js/src/actions/sendMessageToTeamsChannel.ts @@ -8,7 +8,13 @@ import { StringExpression, StringExpressionConverter, } from 'adaptive-expressions'; -import { Activity, Channels, TeamsInfo } from 'botbuilder'; +import { + Activity, + Channels, + CloudAdapterBase, + ConversationReference, + TeamsInfo, +} from 'botbuilder'; import { Converter, ConverterFactory, @@ -19,8 +25,17 @@ import { DialogTurnResult, TemplateInterface, } from 'botbuilder-dialogs'; +import { + AuthenticationConstants, + ClaimsIdentity, + ConnectorClient, + JwtTokenValidation, +} from 'botframework-connector'; import { ActivityTemplateConverter } from 'botbuilder-dialogs-adaptive/lib/converters'; -import { getValue } from './actionHelpers'; +import { + getValue, + testAdapterHasCreateConnectorClientMethod, +} from './actionHelpers'; export interface SendMessageToTeamsChannelConfiguration extends DialogConfiguration { @@ -124,11 +139,58 @@ export class SendMessageToTeamsChannel getValue(dc, this.teamsChannelId) ?? dc.context?.activity.channelData?.channel?.id; - const result = await TeamsInfo.sendMessageToTeamsChannel( - dc.context, - activity, - teamsChannelId - ); + let result: [ConversationReference, string]; + + // Check for legacy adapter + if (testAdapterHasCreateConnectorClientMethod(dc.context.adapter)) { + const credentials = dc.context.turnState.get( + dc.context.adapter.ConnectorClientKey + )?.credentials; + if (!credentials) { + throw new Error( + 'Missing credentials as MicrosoftAppCredentials in ConnectorClient from TurnState' + ); + } + + result = await TeamsInfo.sendMessageToTeamsChannel( + dc.context, + activity, + teamsChannelId + ); + } else if (dc.context.adapter instanceof CloudAdapterBase) { + const botIdentity = dc.context.turnState.get( + dc.context.adapter.BotIdentityKey + ); + + let appId: string | undefined; + if (botIdentity) { + // 'version' is sometimes empty, which will result in no id returned from GetAppIdFromClaims. + appId = JwtTokenValidation.getAppIdFromClaims(botIdentity.claims); + + if (!appId) { + appId = botIdentity.claims.find( + (claim) => claim.type === AuthenticationConstants.AudienceClaim + )?.value; + } + + if (!appId) { + throw new Error('Missing AppIdClaim in ClaimsIdentity'); + } + } else { + throw new Error( + 'Missing dc.context.adapter.BotIdentityKey in TurnContext TurnState' + ); + } + + result = await TeamsInfo.sendMessageToTeamsChannel( + dc.context, + activity, + teamsChannelId, + appId + ); + } else { + throw new Error('The adapter does not support SendMessageToTeamsChannel'); + } if (this.conversationReferenceProperty != null) { dc.state.setValue( diff --git a/tests/unit/packages/Teams/js/tests/actionTests.test.ts b/tests/unit/packages/Teams/js/tests/actionTests.test.ts index 0693de73c8..1492fde260 100644 --- a/tests/unit/packages/Teams/js/tests/actionTests.test.ts +++ b/tests/unit/packages/Teams/js/tests/actionTests.test.ts @@ -12,6 +12,8 @@ import { ConversationAccount, BotAdapter, TestAdapter, + TurnContext, + Middleware, } from 'botbuilder'; import { AdaptiveTeamsBotComponent } from '@microsoft/bot-components-teams'; import { TestUtils } from 'botbuilder-dialogs-adaptive-testing'; @@ -117,6 +119,18 @@ const generateTeamMembers = (amount: number): Record[] => { return members; }; +// This is only used for SendMessageToTeamsChannel test since it has a check in turnState for +// credentials and they never get saved is the adapter is TestAdapter. +class AddConnectorClientMiddleware implements Middleware { + async onTurn(context: TurnContext, next: () => Promise): Promise { + context.turnState.set( + context.adapter.ConnectorClientKey, + new ConnectorClient(new MicrosoftAppCredentials('', '')) + ); + await next(); + } +} + describe('Actions', function () { before(() => nock.disableNetConnect()); beforeEach(() => nock.cleanAll()); @@ -387,6 +401,7 @@ describe('Actions', function () { it('Action_SendMessageToTeamsChannel', async function () { const conversationReference = getGroupConversationReference(); const adapter = getTeamsTestAdapter(conversationReference); + adapter.use(new AddConnectorClientMiddleware()); const fetchExpectation = nock('https://api.botframework.com') .post('/v3/conversations') diff --git a/yarn.lock b/yarn.lock index cd07d252cd..5132c5d503 100644 --- a/yarn.lock +++ b/yarn.lock @@ -159,25 +159,27 @@ __metadata: "@types/lodash": ^4.14.168 "@typescript-eslint/eslint-plugin": latest "@typescript-eslint/parser": latest - adaptive-expressions: ^4.14.0-rc2 - botbuilder: ^4.14.0-rc2 - botbuilder-dialogs: ^4.14.0-rc2 - botbuilder-dialogs-adaptive: ^4.14.0-preview.rc2 - botbuilder-dialogs-adaptive-runtime-core: ^4.14.0-preview.rc2 - botbuilder-dialogs-declarative: ^4.14.0-preview.rc2 - botbuilder-stdlib: ^4.14.0-internal.rc2 + adaptive-expressions: 4.14.0-rc2 + botbuilder: 4.14.0-rc2 + botbuilder-dialogs: 4.14.0-rc2 + botbuilder-dialogs-adaptive: 4.14.0-preview.rc2 + botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview.rc2 + botbuilder-dialogs-declarative: 4.14.0-preview.rc2 + botbuilder-stdlib: 4.14.0-internal.rc2 + botframework-connector: 4.14.0-rc2 eslint: latest lodash: ^4.17.21 rimraf: ^3.0.2 typescript: ^4.0.5 peerDependencies: - 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 + adaptive-expressions: ~4.14.0-rc2 + botbuilder: ~4.14.0-rc2 + botbuilder-dialogs: ~4.14.0-rc2 + botbuilder-dialogs-adaptive: ~4.14.0-preview.rc2 + botbuilder-dialogs-adaptive-runtime-core: ~4.14.0-preview.rc2 + botbuilder-dialogs-declarative: ~4.14.0-preview.rc2 + botbuilder-stdlib: ~4.14.0-internal.rc2 + botframework-connector: ~4.14.0-rc2 lodash: ^4.17.21 languageName: unknown linkType: soft @@ -920,7 +922,7 @@ __metadata: languageName: node linkType: hard -"adaptive-expressions@npm:4.14.0-rc2, adaptive-expressions@npm:^4.14.0-rc2": +"adaptive-expressions@npm:4.14.0-rc2": version: 4.14.0-rc2 resolution: "adaptive-expressions@npm:4.14.0-rc2" dependencies: @@ -1670,7 +1672,7 @@ __metadata: languageName: node linkType: hard -"botbuilder-dialogs-adaptive-runtime-core@npm:4.14.0-preview.rc2, botbuilder-dialogs-adaptive-runtime-core@npm:^4.14.0-preview.rc2": +"botbuilder-dialogs-adaptive-runtime-core@npm:4.14.0-preview.rc2": version: 4.14.0-preview.rc2 resolution: "botbuilder-dialogs-adaptive-runtime-core@npm:4.14.0-preview.rc2" dependencies: @@ -1699,7 +1701,7 @@ __metadata: languageName: node linkType: hard -"botbuilder-dialogs-adaptive@npm:4.14.0-preview.rc2, botbuilder-dialogs-adaptive@npm:^4.14.0-preview.rc2": +"botbuilder-dialogs-adaptive@npm:4.14.0-preview.rc2": version: 4.14.0-preview.rc2 resolution: "botbuilder-dialogs-adaptive@npm:4.14.0-preview.rc2" dependencies: @@ -1716,7 +1718,7 @@ __metadata: languageName: node linkType: hard -"botbuilder-dialogs-declarative@npm:4.14.0-preview.rc2, botbuilder-dialogs-declarative@npm:^4.14.0-preview.rc2": +"botbuilder-dialogs-declarative@npm:4.14.0-preview.rc2": version: 4.14.0-preview.rc2 resolution: "botbuilder-dialogs-declarative@npm:4.14.0-preview.rc2" dependencies: @@ -1728,7 +1730,7 @@ __metadata: languageName: node linkType: hard -"botbuilder-dialogs@npm:4.14.0-rc2, botbuilder-dialogs@npm:^4.14.0-rc2": +"botbuilder-dialogs@npm:4.14.0-rc2": version: 4.14.0-rc2 resolution: "botbuilder-dialogs@npm:4.14.0-rc2" dependencies: @@ -1759,14 +1761,14 @@ __metadata: languageName: node linkType: hard -"botbuilder-stdlib@npm:4.14.0-internal.rc2, botbuilder-stdlib@npm:^4.14.0-internal.rc2": +"botbuilder-stdlib@npm:4.14.0-internal.rc2": version: 4.14.0-internal.rc2 resolution: "botbuilder-stdlib@npm:4.14.0-internal.rc2" checksum: fa437e8cc3d689901ff3a24276e64d7de998a5ce573793b28e026c0dc13631fb391ad7464367049da0e3249bc6a6f0b5a76392c013f351d9b97f6e2454030f07 languageName: node linkType: hard -"botbuilder@npm:4.14.0-rc2, botbuilder@npm:^4.14.0-rc2, botbuilder@npm:rc": +"botbuilder@npm:4.14.0-rc2, botbuilder@npm:rc": version: 4.14.0-rc2 resolution: "botbuilder@npm:4.14.0-rc2" dependencies: From fd823fa8aa3e6acc87c80c14081da9375c03baa2 Mon Sep 17 00:00:00 2001 From: Michael Richardson Date: Wed, 7 Jul 2021 14:58:33 -0700 Subject: [PATCH 08/10] package update --- packages/Teams/js/package.json | 38 +- tests/unit/packages/Teams/js/package.json | 6 +- yarn.lock | 675 ++++++++++++++-------- 3 files changed, 462 insertions(+), 257 deletions(-) diff --git a/packages/Teams/js/package.json b/packages/Teams/js/package.json index fc47a01a55..34f16b2d7d 100644 --- a/packages/Teams/js/package.json +++ b/packages/Teams/js/package.json @@ -29,30 +29,30 @@ "main": "lib/index.js", "types": "lib/index.d.ts", "peerDependencies": { - "adaptive-expressions": "~4.14.0-rc2", - "botbuilder": "~4.14.0-rc2", - "botbuilder-dialogs": "~4.14.0-rc2", - "botbuilder-dialogs-adaptive": "~4.14.0-preview.rc2", - "botbuilder-dialogs-adaptive-runtime-core": "~4.14.0-preview.rc2", - "botbuilder-dialogs-declarative": "~4.14.0-preview.rc2", - "botbuilder-stdlib": "~4.14.0-internal.rc2", - "botframework-connector": "~4.14.0-rc2", + "adaptive-expressions": "~4.14.0", + "botbuilder": "~4.14.0", + "botbuilder-dialogs": "~4.14.0", + "botbuilder-dialogs-adaptive": "~4.14.0-preview", + "botbuilder-dialogs-adaptive-runtime-core": "~4.14.0-preview", + "botbuilder-dialogs-declarative": "~4.14.0-preview", + "botbuilder-stdlib": "~4.14.0-internal", + "botframework-connector": "~4.14.0", "lodash": "^4.17.21" }, "devDependencies": { "@tsconfig/recommended": "^1.0.1", "@types/lodash": "^4.14.168", - "@typescript-eslint/eslint-plugin": "latest", - "@typescript-eslint/parser": "latest", - "adaptive-expressions": "4.14.0-rc2", - "botbuilder": "4.14.0-rc2", - "botbuilder-dialogs": "4.14.0-rc2", - "botbuilder-dialogs-adaptive": "4.14.0-preview.rc2", - "botbuilder-dialogs-adaptive-runtime-core": "4.14.0-preview.rc2", - "botbuilder-dialogs-declarative": "4.14.0-preview.rc2", - "botbuilder-stdlib": "4.14.0-internal.rc2", - "botframework-connector": "4.14.0-rc2", - "eslint": "latest", + "@typescript-eslint/eslint-plugin": "^4.28.2", + "@typescript-eslint/parser": "^4.28.2", + "adaptive-expressions": "4.14.0", + "botbuilder": "4.14.0", + "botbuilder-dialogs": "4.14.0", + "botbuilder-dialogs-adaptive": "4.14.0-preview", + "botbuilder-dialogs-adaptive-runtime-core": "4.14.0-preview", + "botbuilder-dialogs-declarative": "4.14.0-preview", + "botbuilder-stdlib": "4.14.0-internal", + "botframework-connector": "4.14.0", + "eslint": "^7.30.0", "lodash": "^4.17.21", "rimraf": "^3.0.2", "typescript": "^4.0.5" diff --git a/tests/unit/packages/Teams/js/package.json b/tests/unit/packages/Teams/js/package.json index 0779c3c1fc..442b041014 100644 --- a/tests/unit/packages/Teams/js/package.json +++ b/tests/unit/packages/Teams/js/package.json @@ -8,9 +8,9 @@ "dependencies": { "@microsoft/bot-components-teams": "workspace:packages/Teams/js", "@types/mocha": "^8.2.2", - "botbuilder": "rc", - "botbuilder-dialogs-adaptive-testing": "rc", - "botframework-connector": "rc", + "botbuilder": "^4.14.0", + "botbuilder-dialogs-adaptive": "^4.14.0-preview", + "botframework-connector": "^4.14.0", "mocha": "^9.0.2", "nock": "^13.1.1", "ts-node": "^10.0.0" diff --git a/yarn.lock b/yarn.lock index 5132c5d503..75c54ab1bb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,35 +5,6 @@ __metadata: version: 4 cacheKey: 7 -"@azure/abort-controller@npm:^1.0.0": - version: 1.0.4 - resolution: "@azure/abort-controller@npm:1.0.4" - dependencies: - tslib: ^2.0.0 - checksum: e772f6c9afd2c448260f08ef796e4ff73348c5dfd100ce557cf73dd08d7664e819f11f8e59c19a76daa46c1b271ce3061db23072c2150b112df655d38e82944b - languageName: node - linkType: hard - -"@azure/cognitiveservices-luis-runtime@npm:2.0.0": - version: 2.0.0 - resolution: "@azure/cognitiveservices-luis-runtime@npm:2.0.0" - dependencies: - "@azure/ms-rest-js": ^1.6.0 - tslib: ^1.9.3 - checksum: 15d51d16a707a29e9e72e74e96a4227f43a76e12e920328a8f5c7ebb41c711ac11a9676035b2410a198ba9f0007521f650ebd0046709677b557755327a41a325 - languageName: node - linkType: hard - -"@azure/core-auth@npm:^1.1.4": - version: 1.3.2 - resolution: "@azure/core-auth@npm:1.3.2" - dependencies: - "@azure/abort-controller": ^1.0.0 - tslib: ^2.2.0 - checksum: 66c7d074b55e15ecf75c2de64841693c680c326c969dd037bc3800674b658ae1d1b717975c543a34de2da1a1eb1410983d7d2f96ad1d26b61f0372d9214feeb7 - languageName: node - linkType: hard - "@azure/ms-rest-js@npm:1.9.1": version: 1.9.1 resolution: "@azure/ms-rest-js@npm:1.9.1" @@ -50,22 +21,6 @@ __metadata: languageName: node linkType: hard -"@azure/ms-rest-js@npm:^1.6.0": - version: 1.11.2 - resolution: "@azure/ms-rest-js@npm:1.11.2" - dependencies: - "@azure/core-auth": ^1.1.4 - axios: ^0.21.1 - form-data: ^2.3.2 - tough-cookie: ^2.4.3 - tslib: ^1.9.2 - tunnel: 0.0.6 - uuid: ^3.2.1 - xml2js: ^0.4.19 - checksum: a96f2f075ecbef968ad85606087ad8a1d40382d4b9581d184049c46027f2d470b6b669d5dfec722545f54b10e75f8d60ea5a950a69393bc8c431ec81dd5f561b - languageName: node - linkType: hard - "@babel/code-frame@npm:7.12.11": version: 7.12.11 resolution: "@babel/code-frame@npm:7.12.11" @@ -130,6 +85,41 @@ __metadata: languageName: node linkType: hard +"@eslint/eslintrc@npm:^0.4.2": + version: 0.4.2 + resolution: "@eslint/eslintrc@npm:0.4.2" + dependencies: + ajv: ^6.12.4 + debug: ^4.1.1 + espree: ^7.3.0 + globals: ^13.9.0 + ignore: ^4.0.6 + import-fresh: ^3.2.1 + js-yaml: ^3.13.1 + minimatch: ^3.0.4 + strip-json-comments: ^3.1.1 + checksum: 60b66ce4257bf5c36a920dea83a056102fef746e7afd7100a6fe245a126ff455f67f4948e75d28ed73090bff8f8556b6a996e74a124911ca703440bc245dbc23 + languageName: node + linkType: hard + +"@humanwhocodes/config-array@npm:^0.5.0": + version: 0.5.0 + resolution: "@humanwhocodes/config-array@npm:0.5.0" + dependencies: + "@humanwhocodes/object-schema": ^1.2.0 + debug: ^4.1.1 + minimatch: ^3.0.4 + checksum: 71e3c1fef40166ecaacbe29b681499dc6bab3fe45df5bfb3e137baf6e50f22813cf14f24ff759a4da43b6743d7f5a776298ae1e0e266c9602bab62da2ee3b302 + languageName: node + linkType: hard + +"@humanwhocodes/object-schema@npm:^1.2.0": + version: 1.2.0 + resolution: "@humanwhocodes/object-schema@npm:1.2.0" + checksum: ef533ee0d227b8036e4220013575fedc3d0346e2e40bc5f5536ba5761825f23577eb4b71e52f18a2d3b827c9d83cfa60c821a71e30d5f6537918a94bc1990963 + languageName: node + linkType: hard + "@microsoft/bot-components-helpandcancel@workspace:packages/HelpAndCancel": version: 0.0.0-use.local resolution: "@microsoft/bot-components-helpandcancel@workspace:packages/HelpAndCancel" @@ -142,9 +132,9 @@ __metadata: dependencies: "@microsoft/bot-components-teams": "workspace:packages/Teams/js" "@types/mocha": ^8.2.2 - botbuilder: rc - botbuilder-dialogs-adaptive-testing: rc - botframework-connector: rc + botbuilder: ^4.14.0 + botbuilder-dialogs-adaptive: ^4.14.0-preview + botframework-connector: ^4.14.0 mocha: ^9.0.2 nock: ^13.1.1 ts-node: ^10.0.0 @@ -157,29 +147,29 @@ __metadata: dependencies: "@tsconfig/recommended": ^1.0.1 "@types/lodash": ^4.14.168 - "@typescript-eslint/eslint-plugin": latest - "@typescript-eslint/parser": latest - adaptive-expressions: 4.14.0-rc2 - botbuilder: 4.14.0-rc2 - botbuilder-dialogs: 4.14.0-rc2 - botbuilder-dialogs-adaptive: 4.14.0-preview.rc2 - botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview.rc2 - botbuilder-dialogs-declarative: 4.14.0-preview.rc2 - botbuilder-stdlib: 4.14.0-internal.rc2 - botframework-connector: 4.14.0-rc2 - eslint: latest + "@typescript-eslint/eslint-plugin": ^4.28.2 + "@typescript-eslint/parser": ^4.28.2 + adaptive-expressions: 4.14.0 + botbuilder: 4.14.0 + botbuilder-dialogs: 4.14.0 + botbuilder-dialogs-adaptive: 4.14.0-preview + botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview + botbuilder-dialogs-declarative: 4.14.0-preview + botbuilder-stdlib: 4.14.0-internal + botframework-connector: 4.14.0 + eslint: ^7.30.0 lodash: ^4.17.21 rimraf: ^3.0.2 typescript: ^4.0.5 peerDependencies: - adaptive-expressions: ~4.14.0-rc2 - botbuilder: ~4.14.0-rc2 - botbuilder-dialogs: ~4.14.0-rc2 - botbuilder-dialogs-adaptive: ~4.14.0-preview.rc2 - botbuilder-dialogs-adaptive-runtime-core: ~4.14.0-preview.rc2 - botbuilder-dialogs-declarative: ~4.14.0-preview.rc2 - botbuilder-stdlib: ~4.14.0-internal.rc2 - botframework-connector: ~4.14.0-rc2 + adaptive-expressions: ~4.14.0 + botbuilder: ~4.14.0 + botbuilder-dialogs: ~4.14.0 + botbuilder-dialogs-adaptive: ~4.14.0-preview + botbuilder-dialogs-adaptive-runtime-core: ~4.14.0-preview + botbuilder-dialogs-declarative: ~4.14.0-preview + botbuilder-stdlib: ~4.14.0-internal + botframework-connector: ~4.14.0 lodash: ^4.17.21 languageName: unknown linkType: soft @@ -588,10 +578,10 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:^7.0.3": - version: 7.0.7 - resolution: "@types/json-schema@npm:7.0.7" - checksum: b9d2c509fa4e0b82f58e73f5e6ab76c60ff1884ba41bb82f37fb1cece226d4a3e5a62fedf78a43da0005373a6713d9abe61c1e592906402c41c08ad6ab26d52b +"@types/json-schema@npm:^7.0.7": + version: 7.0.8 + resolution: "@types/json-schema@npm:7.0.8" + checksum: 435a3d18a88aeac7bc88c2cdd2c19466c62ce79303493edd72380cd4af9775c05f35d424d5e76ffe3f94575ebb535305c6cae928c5bfb9c39eafbfb6932520a1 languageName: node linkType: hard @@ -719,103 +709,102 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:latest": - version: 4.22.0 - resolution: "@typescript-eslint/eslint-plugin@npm:4.22.0" +"@typescript-eslint/eslint-plugin@npm:^4.28.2": + version: 4.28.2 + resolution: "@typescript-eslint/eslint-plugin@npm:4.28.2" dependencies: - "@typescript-eslint/experimental-utils": 4.22.0 - "@typescript-eslint/scope-manager": 4.22.0 - debug: ^4.1.1 + "@typescript-eslint/experimental-utils": 4.28.2 + "@typescript-eslint/scope-manager": 4.28.2 + debug: ^4.3.1 functional-red-black-tree: ^1.0.1 - lodash: ^4.17.15 - regexpp: ^3.0.0 - semver: ^7.3.2 - tsutils: ^3.17.1 + regexpp: ^3.1.0 + semver: ^7.3.5 + tsutils: ^3.21.0 peerDependencies: "@typescript-eslint/parser": ^4.0.0 eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 40485bbf51283616b5098b33fa5285104a80419c4dcf75659442ae780352289bc238a64591939012ebc47823485497ae6ba8a35e653b0e33ff7f58743b46c34e + checksum: 6af8ea7665d5eaf0bafe241d71e3a85df07c0c82e59f530bd6627e0371e66a2d4a517cacd00d030680fe13d423b065c53185d3f48daa174fea316f024b1ab545 languageName: node linkType: hard -"@typescript-eslint/experimental-utils@npm:4.22.0": - version: 4.22.0 - resolution: "@typescript-eslint/experimental-utils@npm:4.22.0" +"@typescript-eslint/experimental-utils@npm:4.28.2": + version: 4.28.2 + resolution: "@typescript-eslint/experimental-utils@npm:4.28.2" dependencies: - "@types/json-schema": ^7.0.3 - "@typescript-eslint/scope-manager": 4.22.0 - "@typescript-eslint/types": 4.22.0 - "@typescript-eslint/typescript-estree": 4.22.0 - eslint-scope: ^5.0.0 - eslint-utils: ^2.0.0 + "@types/json-schema": ^7.0.7 + "@typescript-eslint/scope-manager": 4.28.2 + "@typescript-eslint/types": 4.28.2 + "@typescript-eslint/typescript-estree": 4.28.2 + eslint-scope: ^5.1.1 + eslint-utils: ^3.0.0 peerDependencies: eslint: "*" - checksum: afabf0d6f9e70b910575d8bc2e8ccd3416e8d05ed968296fc56379f71f8cf3a27107598b98f7c76a91e6b0be796dc102c866381a3af5bf24799a333532d1e997 + checksum: 5b3fed818af9882ae54bf258351c2740a92aa0bb5a85478ce1d4d957e594882ece42048149b1a1a8500023c1d334d9846048bc96f309ed60715232be8ef5d1a8 languageName: node linkType: hard -"@typescript-eslint/parser@npm:latest": - version: 4.22.0 - resolution: "@typescript-eslint/parser@npm:4.22.0" +"@typescript-eslint/parser@npm:^4.28.2": + version: 4.28.2 + resolution: "@typescript-eslint/parser@npm:4.28.2" dependencies: - "@typescript-eslint/scope-manager": 4.22.0 - "@typescript-eslint/types": 4.22.0 - "@typescript-eslint/typescript-estree": 4.22.0 - debug: ^4.1.1 + "@typescript-eslint/scope-manager": 4.28.2 + "@typescript-eslint/types": 4.28.2 + "@typescript-eslint/typescript-estree": 4.28.2 + debug: ^4.3.1 peerDependencies: eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 679e14a5cec5bae3b392b1736f5d919897fd1a269a9d25366babfd12c1d275b320ae36a0b8be215ba14780cb1feec2b386001b4e0225ef82bd0040bf5dbaf99f + checksum: 4d71ddbe039007f366b6e9deca12183e45ea165053a29b64e8e4534451a134fe664fd3bf8ec06951e2afe8b5fd14143fb2ef3182a9ee8d2b20a89a3c0f4f2529 languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:4.22.0": - version: 4.22.0 - resolution: "@typescript-eslint/scope-manager@npm:4.22.0" +"@typescript-eslint/scope-manager@npm:4.28.2": + version: 4.28.2 + resolution: "@typescript-eslint/scope-manager@npm:4.28.2" dependencies: - "@typescript-eslint/types": 4.22.0 - "@typescript-eslint/visitor-keys": 4.22.0 - checksum: c6f5565f517373cba61d29be919c69ad0e178f2a007eed6f1d8f80518853c3c4e6a3a059e492920b71675f0828e093eb36ec9eef318b9e2b4e9e65b0e93f03b6 + "@typescript-eslint/types": 4.28.2 + "@typescript-eslint/visitor-keys": 4.28.2 + checksum: 31c30f428ba50087fc6a8dacc00b4d007d6653f1ea261a468e0a5425d730c5bf1e87bea581494862687c294d1f2ace30813f919800a05190fa332db6cd192bef languageName: node linkType: hard -"@typescript-eslint/types@npm:4.22.0": - version: 4.22.0 - resolution: "@typescript-eslint/types@npm:4.22.0" - checksum: db2717132540feba39b002cdb2483aa822e0b50c17f9deff918a52609178df071444188a1e76c07c51018c353b01509dd741272b6d482edf7d9e7d60adc6c70e +"@typescript-eslint/types@npm:4.28.2": + version: 4.28.2 + resolution: "@typescript-eslint/types@npm:4.28.2" + checksum: 9f5e6bf3df4540adf8eb1f83909bac778257f60a6ef7fcafa7df5224949839a63dba61fe4b58de538ffe17517e88ff6b29f691209f80a55df87935bac6349f69 languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:4.22.0": - version: 4.22.0 - resolution: "@typescript-eslint/typescript-estree@npm:4.22.0" +"@typescript-eslint/typescript-estree@npm:4.28.2": + version: 4.28.2 + resolution: "@typescript-eslint/typescript-estree@npm:4.28.2" dependencies: - "@typescript-eslint/types": 4.22.0 - "@typescript-eslint/visitor-keys": 4.22.0 - debug: ^4.1.1 - globby: ^11.0.1 + "@typescript-eslint/types": 4.28.2 + "@typescript-eslint/visitor-keys": 4.28.2 + debug: ^4.3.1 + globby: ^11.0.3 is-glob: ^4.0.1 - semver: ^7.3.2 - tsutils: ^3.17.1 + semver: ^7.3.5 + tsutils: ^3.21.0 peerDependenciesMeta: typescript: optional: true - checksum: 538d932361d1463c9450c155fc5696f4cc1a07db2bfd4ca9079e1f919e5062fd95d8dc128fc2fa8368c9582787cfc97ee6284083b94fe8d580cd1a9fca688efa + checksum: 4fe36863b8af9808ee86b3cf64d6076a8b9a3224f9e1c17650d06ea46d80225b7e94903f71e7330a682b84eb1045189f1f09dc896165e9cab36714d24992ee84 languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:4.22.0": - version: 4.22.0 - resolution: "@typescript-eslint/visitor-keys@npm:4.22.0" +"@typescript-eslint/visitor-keys@npm:4.28.2": + version: 4.28.2 + resolution: "@typescript-eslint/visitor-keys@npm:4.28.2" dependencies: - "@typescript-eslint/types": 4.22.0 + "@typescript-eslint/types": 4.28.2 eslint-visitor-keys: ^2.0.0 - checksum: 645896d05aa757fac02d952574ecda0eecd0be120162e28533c4528bb70d2162e9df62c3547217c69f18a72ceecaf212ea585afd20f976db64b59ac6de0d1ec8 + checksum: cec563831f563bb057f00045104db7ed92576755065d7563607c5f3581e5588fe8b83229767cd81763136aeb663dd49b99e7ee24decfbfc5fc7bd7b36bb1a525 languageName: node linkType: hard @@ -922,6 +911,34 @@ __metadata: languageName: node linkType: hard +"adaptive-expressions@npm:4.14.0": + version: 4.14.0 + resolution: "adaptive-expressions@npm:4.14.0" + 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 + atob-lite: ^2.0.0 + big-integer: ^1.6.48 + btoa-lite: ^1.0.0 + 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: de9b382e92ffe2bea6236ad40a19e73ab797e65943180e54392159c1731f3dc2138dda1d1af81c51bcc36e9a41410f64783f3ca13085933d36cbb2826e3a55b0 + languageName: node + linkType: hard + "adaptive-expressions@npm:4.14.0-rc2": version: 4.14.0-rc2 resolution: "adaptive-expressions@npm:4.14.0-rc2" @@ -974,6 +991,18 @@ __metadata: languageName: node linkType: hard +"ajv@npm:^8.0.1": + version: 8.6.1 + resolution: "ajv@npm:8.6.1" + dependencies: + fast-deep-equal: ^3.1.1 + json-schema-traverse: ^1.0.0 + require-from-string: ^2.0.2 + uri-js: ^4.2.2 + checksum: 9abb66b4ced54f0e955313387183615028df1affc28859332d5d935258e391ead880ad5a4e5c59e3b82367486b3824faefdaf7b87cfd3a5b6629f14e8edc2fd7 + languageName: node + linkType: hard + "ansi-colors@npm:4.1.1, ansi-colors@npm:^4.1.1": version: 4.1.1 resolution: "ansi-colors@npm:4.1.1" @@ -1620,13 +1649,6 @@ __metadata: languageName: node linkType: hard -"bitwise@npm:^2.0.4": - version: 2.1.0 - resolution: "bitwise@npm:2.1.0" - checksum: 51c7ae49c2c109444c6aafaf221b86c8caf10c60c3ac0316b0cb1a76d12c8af383170bec22863bdd378ac05730a145a0026a9ce1fe2ff4925dc75c3288e45011 - languageName: node - linkType: hard - "bl@npm:^4.1.0": version: 4.1.0 resolution: "bl@npm:4.1.0" @@ -1638,23 +1660,17 @@ __metadata: languageName: node linkType: hard -"botbuilder-ai@npm:4.14.0-rc2": - version: 4.14.0-rc2 - resolution: "botbuilder-ai@npm:4.14.0-rc2" +"botbuilder-core@npm:4.14.0": + version: 4.14.0 + resolution: "botbuilder-core@npm:4.14.0" dependencies: - "@azure/cognitiveservices-luis-runtime": 2.0.0 - "@azure/ms-rest-js": 1.9.1 - adaptive-expressions: 4.14.0-rc2 - botbuilder-core: 4.14.0-rc2 - botbuilder-dialogs: 4.14.0-rc2 - botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview.rc2 - botbuilder-dialogs-declarative: 4.14.0-preview.rc2 - botbuilder-stdlib: 4.14.0-internal.rc2 - lodash: ^4.17.21 - node-fetch: ^2.6.0 - url-parse: ^1.5.1 + botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview + botbuilder-stdlib: 4.14.0-internal + botframework-connector: 4.14.0 + botframework-schema: 4.14.0 + uuid: ^8.3.2 zod: ~1.11.17 - checksum: 52ff6eef8570c0ee2354f432663ff045c15ec63a282ed99c962be890a770c5a44397560808a2bf5dc49e8e3bd9720258fc5e8c03a0a1066fe1c215d6cb97a024 + checksum: b617e7fea0120460113d59062cdf12f7903eea36d7941089dfe55aae3ba4abf8b3990e09273d76a584095303c972712762a0d87263360f7b4eab3e2c5ed6e017 languageName: node linkType: hard @@ -1672,6 +1688,15 @@ __metadata: languageName: node linkType: hard +"botbuilder-dialogs-adaptive-runtime-core@npm:4.14.0-preview": + version: 4.14.0-preview + resolution: "botbuilder-dialogs-adaptive-runtime-core@npm:4.14.0-preview" + dependencies: + dependency-graph: ^0.10.0 + checksum: 8bc38639faa59e541a32feac99d7eb3428d6a5a2071d2cdaaee3b1480224ed213cfa00f974236f76b4169848bf2189e19e4e08a1415b4646b4e58ebc3aee1da1 + languageName: node + linkType: hard + "botbuilder-dialogs-adaptive-runtime-core@npm:4.14.0-preview.rc2": version: 4.14.0-preview.rc2 resolution: "botbuilder-dialogs-adaptive-runtime-core@npm:4.14.0-preview.rc2" @@ -1681,27 +1706,24 @@ __metadata: languageName: node linkType: hard -"botbuilder-dialogs-adaptive-testing@npm:rc": - version: 4.14.0-preview.rc2 - resolution: "botbuilder-dialogs-adaptive-testing@npm:4.14.0-preview.rc2" +"botbuilder-dialogs-adaptive@npm:4.14.0-preview": + version: 4.14.0-preview + resolution: "botbuilder-dialogs-adaptive@npm:4.14.0-preview" dependencies: - adaptive-expressions: 4.14.0-rc2 - bitwise: ^2.0.4 - botbuilder-ai: 4.14.0-rc2 - botbuilder-core: 4.14.0-rc2 - botbuilder-dialogs: 4.14.0-rc2 - botbuilder-dialogs-adaptive: 4.14.0-preview.rc2 - botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview.rc2 - botbuilder-dialogs-declarative: 4.14.0-preview.rc2 - botbuilder-stdlib: 4.14.0-internal.rc2 - murmurhash-js: ^1.0.0 - nock: ^11.9.1 - url-parse: ^1.5.1 - checksum: 1dd15e908939fb7c74a6c3b627f152cdf7fc5420a62580e17962ed39f1d4c7a39d0b00659661f519e4348c4e64ff4064928ecedba0012382b7eb71f2ffdf4ced + "@microsoft/recognizers-text-suite": 1.1.4 + adaptive-expressions: 4.14.0 + botbuilder: 4.14.0 + botbuilder-dialogs: 4.14.0 + botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview + botbuilder-dialogs-declarative: 4.14.0-preview + botbuilder-lg: 4.14.0 + lodash: ^4.17.21 + node-fetch: ^2.6.0 + checksum: 622237a71b8f63e8cb5e536910a0e6997dc47c1f130c09877d134dd9909873fb1a12677e4d3228c97ae7a4dd1933cdd2314c4a1c5dda059ff879687eec151ecc languageName: node linkType: hard -"botbuilder-dialogs-adaptive@npm:4.14.0-preview.rc2": +"botbuilder-dialogs-adaptive@npm:^4.14.0-preview": version: 4.14.0-preview.rc2 resolution: "botbuilder-dialogs-adaptive@npm:4.14.0-preview.rc2" dependencies: @@ -1718,6 +1740,18 @@ __metadata: languageName: node linkType: hard +"botbuilder-dialogs-declarative@npm:4.14.0-preview": + version: 4.14.0-preview + resolution: "botbuilder-dialogs-declarative@npm:4.14.0-preview" + dependencies: + botbuilder-core: 4.14.0 + botbuilder-dialogs: 4.14.0 + botbuilder-stdlib: 4.14.0-internal + chokidar: ^3.4.0 + checksum: 25863f1a2e4edd5982a5d103c44aa8f66c2ff16adf07a2fff8d49c48084f2c2143470478b978fbae0c6c82cf2f88e6fcd82a6887453f53526d186bd96d462c50 + languageName: node + linkType: hard + "botbuilder-dialogs-declarative@npm:4.14.0-preview.rc2": version: 4.14.0-preview.rc2 resolution: "botbuilder-dialogs-declarative@npm:4.14.0-preview.rc2" @@ -1730,6 +1764,25 @@ __metadata: languageName: node linkType: hard +"botbuilder-dialogs@npm:4.14.0": + version: 4.14.0 + resolution: "botbuilder-dialogs@npm:4.14.0" + 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.14.0 + botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview + botbuilder-stdlib: 4.14.0-internal + botframework-connector: 4.14.0 + globalize: ^1.4.2 + lodash: ^4.17.21 + zod: ~1.11.17 + checksum: c1f58e6b4bddeeea500f5bea3e1552478b39e11ea679f7d7771cf1bfb29cb79df627ac8405f3997a713338dde6861e0c465e4ab5fa78bf817264b5e49132a56a + languageName: node + linkType: hard + "botbuilder-dialogs@npm:4.14.0-rc2": version: 4.14.0-rc2 resolution: "botbuilder-dialogs@npm:4.14.0-rc2" @@ -1749,6 +1802,18 @@ __metadata: languageName: node linkType: hard +"botbuilder-lg@npm:4.14.0": + version: 4.14.0 + resolution: "botbuilder-lg@npm:4.14.0" + dependencies: + adaptive-expressions: 4.14.0 + antlr4ts: 0.5.0-alpha.3 + lodash: ^4.17.19 + uuid: ^8.3.2 + checksum: b7602b0fabdb80994c6949f78fcd6f467917799586d857be37add227a8c261a6b4e4b24ad4d12e41ab458c062fa6fe68cb0bdb8cffa0f4f60b5ef7ea291add08 + languageName: node + linkType: hard + "botbuilder-lg@npm:4.14.0-rc2": version: 4.14.0-rc2 resolution: "botbuilder-lg@npm:4.14.0-rc2" @@ -1761,6 +1826,13 @@ __metadata: languageName: node linkType: hard +"botbuilder-stdlib@npm:4.14.0-internal": + version: 4.14.0-internal + resolution: "botbuilder-stdlib@npm:4.14.0-internal" + checksum: e38630a1ae535c06422033b1301b764977cfd06259904d25c6a8bd72a676865c456fcdb792ce3abf03a3bb508bb212ab93a4b81702a32384cf297abe7dc9b8d4 + languageName: node + linkType: hard + "botbuilder-stdlib@npm:4.14.0-internal.rc2": version: 4.14.0-internal.rc2 resolution: "botbuilder-stdlib@npm:4.14.0-internal.rc2" @@ -1768,7 +1840,27 @@ __metadata: languageName: node linkType: hard -"botbuilder@npm:4.14.0-rc2, botbuilder@npm:rc": +"botbuilder@npm:4.14.0, botbuilder@npm:^4.14.0": + version: 4.14.0 + resolution: "botbuilder@npm:4.14.0" + dependencies: + "@azure/ms-rest-js": 1.9.1 + axios: ^0.21.1 + botbuilder-core: 4.14.0 + botbuilder-stdlib: 4.14.0-internal + botframework-connector: 4.14.0 + botframework-streaming: 4.14.0 + dayjs: ^1.10.3 + filenamify: ^4.1.0 + fs-extra: ^7.0.1 + htmlparser2: ^6.0.1 + uuid: ^8.3.2 + zod: ~1.11.17 + checksum: a916227bc341fc106be36f8fde60f7e83ebb8e05014d5c314c0a515711cd70595615d183989286557bad1ef08a5ad923a4bb03758a03cbc28440facafb9b0932 + languageName: node + linkType: hard + +"botbuilder@npm:4.14.0-rc2": version: 4.14.0-rc2 resolution: "botbuilder@npm:4.14.0-rc2" dependencies: @@ -1788,7 +1880,26 @@ __metadata: languageName: node linkType: hard -"botframework-connector@npm:4.14.0-rc2, botframework-connector@npm:rc": +"botframework-connector@npm:4.14.0, botframework-connector@npm:^4.14.0": + version: 4.14.0 + resolution: "botframework-connector@npm:4.14.0" + dependencies: + "@azure/ms-rest-js": 1.9.1 + "@types/jsonwebtoken": 7.2.8 + "@types/node": ^10.17.27 + adal-node: 0.2.2 + axios: ^0.21.1 + base64url: ^3.0.0 + botbuilder-stdlib: 4.14.0-internal + botframework-schema: 4.14.0 + cross-fetch: ^3.0.5 + jsonwebtoken: 8.0.1 + rsa-pem-from-mod-exp: ^0.8.4 + checksum: 565e2475524cd3ee3d2e4ddd83890e58a15e68f128daf9be5ad943e38c3088e8ed1a7f04c082825059a83fb007106ec1047e90aec19235665c27a526d0e9443e + languageName: node + linkType: hard + +"botframework-connector@npm:4.14.0-rc2": version: 4.14.0-rc2 resolution: "botframework-connector@npm:4.14.0-rc2" dependencies: @@ -1807,6 +1918,16 @@ __metadata: languageName: node linkType: hard +"botframework-schema@npm:4.14.0": + version: 4.14.0 + resolution: "botframework-schema@npm:4.14.0" + dependencies: + botbuilder-stdlib: 4.14.0-internal + uuid: ^8.3.2 + checksum: fd86f0a6eb5be4f84c90bdb58de20129fdd92138652aaebc4cc29ccdf7e0f7944e85c1c007ecb654d576b734fce984466ff2d7edc2f98c344f1210b23f0badf1 + languageName: node + linkType: hard + "botframework-schema@npm:4.14.0-rc2": version: 4.14.0-rc2 resolution: "botframework-schema@npm:4.14.0-rc2" @@ -1817,6 +1938,18 @@ __metadata: languageName: node linkType: hard +"botframework-streaming@npm:4.14.0": + version: 4.14.0 + resolution: "botframework-streaming@npm:4.14.0" + dependencies: + "@types/node": ^10.17.27 + "@types/ws": ^6.0.3 + uuid: ^8.3.2 + ws: ^7.1.2 + checksum: c23f75c1ddd95f2265bbf77c68ba0c188492398daaa0cda1cab113e9d22dcf63aec1831a5ce1df7382b91f20c0202c12e9afa4c6de799d64690825d3c3b5f76a + languageName: node + linkType: hard + "botframework-streaming@npm:4.14.0-rc2": version: 4.14.0-rc2 resolution: "botframework-streaming@npm:4.14.0-rc2" @@ -2616,7 +2749,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:^4.0.1, debug@npm:^4.1.0": +"debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.3.1": version: 4.3.2 resolution: "debug@npm:4.3.2" dependencies: @@ -3047,7 +3180,7 @@ __metadata: languageName: node linkType: hard -"escape-string-regexp@npm:4.0.0": +"escape-string-regexp@npm:4.0.0, escape-string-regexp@npm:^4.0.0": version: 4.0.0 resolution: "escape-string-regexp@npm:4.0.0" checksum: c747be8d5ff7873127e3e0cffe7d2206a37208077fa9c30a3c1bb4f26bebd081c8c24d5fba7a99449f9d20670bea3dc5e1b6098b0f074b099bd38766271a272f @@ -3113,7 +3246,7 @@ __metadata: languageName: node linkType: hard -"eslint-scope@npm:^5.0.0, eslint-scope@npm:^5.1.1": +"eslint-scope@npm:^5.1.1": version: 5.1.1 resolution: "eslint-scope@npm:5.1.1" dependencies: @@ -3123,7 +3256,7 @@ __metadata: languageName: node linkType: hard -"eslint-utils@npm:^2.0.0, eslint-utils@npm:^2.1.0": +"eslint-utils@npm:^2.1.0": version: 2.1.0 resolution: "eslint-utils@npm:2.1.0" dependencies: @@ -3132,6 +3265,17 @@ __metadata: languageName: node linkType: hard +"eslint-utils@npm:^3.0.0": + version: 3.0.0 + resolution: "eslint-utils@npm:3.0.0" + dependencies: + eslint-visitor-keys: ^2.0.0 + peerDependencies: + eslint: ">=5" + checksum: 035451529f016e28edd26e8951f15e28a6a4e58adff67bd0cb494879f360080750b9c779e46561369aec0657ac2b89dd8b0aa38476e8cdf50e635aa872fa27b6 + languageName: node + linkType: hard + "eslint-visitor-keys@npm:^1.1.0, eslint-visitor-keys@npm:^1.3.0": version: 1.3.0 resolution: "eslint-visitor-keys@npm:1.3.0" @@ -3146,6 +3290,56 @@ __metadata: languageName: node linkType: hard +"eslint@npm:^7.30.0": + version: 7.30.0 + resolution: "eslint@npm:7.30.0" + dependencies: + "@babel/code-frame": 7.12.11 + "@eslint/eslintrc": ^0.4.2 + "@humanwhocodes/config-array": ^0.5.0 + ajv: ^6.10.0 + chalk: ^4.0.0 + cross-spawn: ^7.0.2 + debug: ^4.0.1 + doctrine: ^3.0.0 + enquirer: ^2.3.5 + escape-string-regexp: ^4.0.0 + eslint-scope: ^5.1.1 + eslint-utils: ^2.1.0 + eslint-visitor-keys: ^2.0.0 + espree: ^7.3.1 + esquery: ^1.4.0 + esutils: ^2.0.2 + fast-deep-equal: ^3.1.3 + file-entry-cache: ^6.0.1 + functional-red-black-tree: ^1.0.1 + glob-parent: ^5.1.2 + globals: ^13.6.0 + ignore: ^4.0.6 + import-fresh: ^3.0.0 + imurmurhash: ^0.1.4 + is-glob: ^4.0.0 + js-yaml: ^3.13.1 + json-stable-stringify-without-jsonify: ^1.0.1 + levn: ^0.4.1 + lodash.merge: ^4.6.2 + minimatch: ^3.0.4 + natural-compare: ^1.4.0 + optionator: ^0.9.1 + progress: ^2.0.0 + regexpp: ^3.1.0 + semver: ^7.2.1 + strip-ansi: ^6.0.0 + strip-json-comments: ^3.1.0 + table: ^6.0.9 + text-table: ^0.2.0 + v8-compile-cache: ^2.0.3 + bin: + eslint: bin/eslint.js + checksum: 028048847e0252d6c972ac612fe37be55822ae2255d10d1bf68255749f7ae1364b2aa538cd95f3bc4d951fc7d36195e46b62fe8d215297ef9a6a8aeb8ca28a90 + languageName: node + linkType: hard + "eslint@npm:latest": version: 7.21.0 resolution: "eslint@npm:7.21.0" @@ -3435,7 +3629,7 @@ __metadata: languageName: node linkType: hard -"fast-deep-equal@npm:^3.1.1": +"fast-deep-equal@npm:^3.1.1, fast-deep-equal@npm:^3.1.3": version: 3.1.3 resolution: "fast-deep-equal@npm:3.1.3" checksum: 451526766b219503131d11e823eaadd1533080b0be4860e316670b039dcaf31cd1007c2fe036a9b922abba7c040dfad5e942ed79d21f2ff849e50049f36e0fb7 @@ -4024,7 +4218,7 @@ fsevents@^1.2.3: languageName: node linkType: hard -"glob-parent@npm:^5.0.0, glob-parent@npm:^5.1.0, glob-parent@npm:~5.1.0, glob-parent@npm:~5.1.2": +"glob-parent@npm:^5.0.0, glob-parent@npm:^5.1.0, glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.0, glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" dependencies: @@ -4086,6 +4280,15 @@ fsevents@^1.2.3: languageName: node linkType: hard +"globals@npm:^13.6.0, globals@npm:^13.9.0": + version: 13.10.0 + resolution: "globals@npm:13.10.0" + dependencies: + type-fest: ^0.20.2 + checksum: ae5f8d4ef26b845a3d2a370a0dd0b7cc8bce09d11bf75dbde8dce8a0855e8ad4f34613090eaad8e71d24fb01fe00d8b2708533b32da08f104c0ddd19b70219f1 + languageName: node + linkType: hard + "globals@npm:^9.18.0": version: 9.18.0 resolution: "globals@npm:9.18.0" @@ -4093,9 +4296,9 @@ fsevents@^1.2.3: languageName: node linkType: hard -"globby@npm:^11.0.1, globby@npm:^11.0.3": - version: 11.0.3 - resolution: "globby@npm:11.0.3" +"globby@npm:^11.0.2": + version: 11.0.2 + resolution: "globby@npm:11.0.2" dependencies: array-union: ^2.1.0 dir-glob: ^3.0.1 @@ -4103,13 +4306,13 @@ fsevents@^1.2.3: ignore: ^5.1.4 merge2: ^1.3.0 slash: ^3.0.0 - checksum: f17da0f869918656ec8c16c15ad100f025fbd13e4c157286cf340811eb1355a7d06dde77be1685a7a051970ec6abeff96a9b2a1a97525f84bc94fbd518c1d1db + checksum: d23f2a6b8897b97fb27422cde243e0fd406ebbaa821929293b27c977d169884f8112494cda4f456a51d0ec1e133e3ac703ec24bfed484e327305ea34a665eb06 languageName: node linkType: hard -"globby@npm:^11.0.2": - version: 11.0.2 - resolution: "globby@npm:11.0.2" +"globby@npm:^11.0.3": + version: 11.0.3 + resolution: "globby@npm:11.0.3" dependencies: array-union: ^2.1.0 dir-glob: ^3.0.1 @@ -4117,7 +4320,7 @@ fsevents@^1.2.3: ignore: ^5.1.4 merge2: ^1.3.0 slash: ^3.0.0 - checksum: d23f2a6b8897b97fb27422cde243e0fd406ebbaa821929293b27c977d169884f8112494cda4f456a51d0ec1e133e3ac703ec24bfed484e327305ea34a665eb06 + checksum: f17da0f869918656ec8c16c15ad100f025fbd13e4c157286cf340811eb1355a7d06dde77be1685a7a051970ec6abeff96a9b2a1a97525f84bc94fbd518c1d1db languageName: node linkType: hard @@ -6096,6 +6299,13 @@ fsevents@^1.2.3: languageName: node linkType: hard +"lodash.clonedeep@npm:^4.5.0": + version: 4.5.0 + resolution: "lodash.clonedeep@npm:4.5.0" + checksum: 41e2fe4c57c56a66a4775a6ddeebe9272f0ce4d257d97b3cb8724a9b01eeec9b09ce7e8603d6926baf5f48c287d988f0de4bf5aa244ea86b1f22c1e6f203cc27 + languageName: node + linkType: hard + "lodash.escaperegexp@npm:^4.1.2": version: 4.1.2 resolution: "lodash.escaperegexp@npm:4.1.2" @@ -6173,6 +6383,13 @@ fsevents@^1.2.3: languageName: node linkType: hard +"lodash.merge@npm:^4.6.2": + version: 4.6.2 + resolution: "lodash.merge@npm:4.6.2" + checksum: 4e2bb42a87a148991458d7c384bc197e96f7115e9536fc8e2c86ae9e99ce1c1f693ff15eb85761952535f48d72253aed8e673d9f32dde3e671cd91e3fde220a7 + languageName: node + linkType: hard + "lodash.once@npm:^4.0.0": version: 4.1.1 resolution: "lodash.once@npm:4.1.1" @@ -6208,6 +6425,13 @@ fsevents@^1.2.3: languageName: node linkType: hard +"lodash.truncate@npm:^4.4.2": + version: 4.4.2 + resolution: "lodash.truncate@npm:4.4.2" + checksum: b1b0d7d993bb73d0032fe909d4523a836b6aa91566fa88ff78c3eac008bd3d3b2ba0f2e8381d7f906b1d6913a64982f34bea95dd556355c0d418bfddf3ab7b06 + languageName: node + linkType: hard + "lodash.zip@npm:^4.0.0": version: 4.2.0 resolution: "lodash.zip@npm:4.2.0" @@ -6215,7 +6439,7 @@ fsevents@^1.2.3: languageName: node linkType: hard -"lodash@npm:^4.17.10, lodash@npm:^4.17.11, lodash@npm:^4.17.13, lodash@npm:^4.17.14, lodash@npm:^4.17.15, lodash@npm:^4.17.19, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.17.4, lodash@npm:^4.3.0": +"lodash@npm:^4.17.10, lodash@npm:^4.17.11, lodash@npm:^4.17.14, lodash@npm:^4.17.15, lodash@npm:^4.17.19, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.17.4, lodash@npm:^4.3.0": version: 4.17.21 resolution: "lodash@npm:4.17.21" checksum: 4983720b9abca930a4a46f18db163d7dad8dd00dbed6db0cc7b499b33b717cce69f80928b27bbb1ff2cbd3b19d251ee90669a8b5ea466072ca81c2ebe91e7468 @@ -6817,13 +7041,6 @@ fsevents@^1.2.3: languageName: node linkType: hard -"murmurhash-js@npm:^1.0.0": - version: 1.0.0 - resolution: "murmurhash-js@npm:1.0.0" - checksum: 7b0f02796fde7a6fe0e41ed3197b758e6824f33b284a5cbdcca0942e629d34309a4e344760204ad5503dc1d75f9ba7574b72406ac654dc56ab69f22b1e9ee821 - languageName: node - linkType: hard - "mute-stream@npm:0.0.7": version: 0.0.7 resolution: "mute-stream@npm:0.0.7" @@ -6931,19 +7148,6 @@ fsevents@^1.2.3: languageName: node linkType: hard -"nock@npm:^11.9.1": - version: 11.9.1 - resolution: "nock@npm:11.9.1" - dependencies: - debug: ^4.1.0 - json-stringify-safe: ^5.0.1 - lodash: ^4.17.13 - mkdirp: ^0.5.0 - propagate: ^2.0.0 - checksum: 4cbbe7ee50d7a1514c60dfdbd40e10b9ec51035b8f0282dbb1bdd795ae2dd6d8612713b5edcf7fb1034f2d6b4449f672be71880702f1f5d36e06b0e718731ffc - languageName: node - linkType: hard - "nock@npm:^13.1.1": version: 13.1.1 resolution: "nock@npm:13.1.1" @@ -7845,13 +8049,6 @@ fsevents@^1.2.3: languageName: node linkType: hard -"querystringify@npm:^2.1.1": - version: 2.2.0 - resolution: "querystringify@npm:2.2.0" - checksum: 6235036be3aedff7919dfc06b23f759264915c5794c6352d52a917401d40d2b9bb43b1d82e4e5be983e469aa320e06992aefc218192f6fa1d9eba4f54dc4786c - languageName: node - linkType: hard - "queue-microtask@npm:^1.2.2": version: 1.2.2 resolution: "queue-microtask@npm:1.2.2" @@ -8075,7 +8272,7 @@ fsevents@^1.2.3: languageName: node linkType: hard -"regexpp@npm:^3.0.0, regexpp@npm:^3.1.0": +"regexpp@npm:^3.1.0": version: 3.1.0 resolution: "regexpp@npm:3.1.0" checksum: 69d0ce6b449cf35d3732d6341a1e70850360ffc619f8eef10629871c462e614853fffb80d3f00fc17cd0bb5b8f34b0cde5be4b434e72c0eb3fbba2360c8b5ac4 @@ -8201,13 +8398,6 @@ fsevents@^1.2.3: languageName: node linkType: hard -"requires-port@npm:^1.0.0": - version: 1.0.0 - resolution: "requires-port@npm:1.0.0" - checksum: 0db25fb2ac9b4f2345a350846b7ba99d1f25a6686b1728246d14f05450c8f2fc066bdfae4561b4be2627c184a030a27e17268cfefdf46836e271db13734bc49e - languageName: node - linkType: hard - "resolve-cwd@npm:^2.0.0": version: 2.0.0 resolution: "resolve-cwd@npm:2.0.0" @@ -8503,6 +8693,17 @@ resolve@1.1.7: languageName: node linkType: hard +"semver@npm:^7.3.5": + version: 7.3.5 + resolution: "semver@npm:7.3.5" + dependencies: + lru-cache: ^6.0.0 + bin: + semver: bin/semver.js + checksum: c53624ddf4b9779bcbf55a1eb8b37074cc44bfeca416f3cc263429408202a8a3c59b00eef8c647d697303bc39b95c022a5c61959221d3814bfb1270ff7c14986 + languageName: node + linkType: hard + "serialize-javascript@npm:5.0.1": version: 5.0.1 resolution: "serialize-javascript@npm:5.0.1" @@ -9142,6 +9343,20 @@ resolve@1.1.7: languageName: node linkType: hard +"table@npm:^6.0.9": + version: 6.7.1 + resolution: "table@npm:6.7.1" + dependencies: + ajv: ^8.0.1 + lodash.clonedeep: ^4.5.0 + lodash.truncate: ^4.4.2 + slice-ansi: ^4.0.0 + string-width: ^4.2.0 + strip-ansi: ^6.0.0 + checksum: 66107046b7226051552d53c1260facfed03f4050373d3888620af7b1353f6a5429d9a4a5fb796c56c29b9dd5ffca7b661a815f42ec392cb5956432585578772a + languageName: node + linkType: hard + "tar@npm:^6.0.2": version: 6.1.0 resolution: "tar@npm:6.1.0" @@ -9370,21 +9585,14 @@ resolve@1.1.7: languageName: node linkType: hard -"tslib@npm:^1.8.1, tslib@npm:^1.9.0, tslib@npm:^1.9.2, tslib@npm:^1.9.3": +"tslib@npm:^1.8.1, tslib@npm:^1.9.0, tslib@npm:^1.9.2": version: 1.14.1 resolution: "tslib@npm:1.14.1" checksum: f44fe7f216946b17d3e3074df3746372703cf24e9127b4c045511456e8e4bf25515fb0a1bb3937676cc305651c5d4fcb6377b0588a4c6a957e748c4c28905d17 languageName: node linkType: hard -"tslib@npm:^2.0.0, tslib@npm:^2.2.0": - version: 2.3.0 - resolution: "tslib@npm:2.3.0" - checksum: 7b4fc9feff0f704743c3760f5d8d708f6417fac6458159e63df3a6b1100f0736e3b99edb9fe370f274ad15160a1f49ff05cb49402534c818ff552c48e38c3e6e - languageName: node - linkType: hard - -"tsutils@npm:^3.17.1": +"tsutils@npm:^3.21.0": version: 3.21.0 resolution: "tsutils@npm:3.21.0" dependencies: @@ -9450,6 +9658,13 @@ resolve@1.1.7: languageName: node linkType: hard +"type-fest@npm:^0.20.2": + version: 0.20.2 + resolution: "type-fest@npm:0.20.2" + checksum: 1f887bc6150e632fb772fd28e33c22a4ab036c6f484fa9ac2e2115f6cae9d62bba7ca0368e3332b539d85bd2c8391c7bff22ad410abcbc9ab3774d61e250b210 + languageName: node + linkType: hard + "type-fest@npm:^0.6.0": version: 0.6.0 resolution: "type-fest@npm:0.6.0" @@ -9605,16 +9820,6 @@ typescript@^4.0.5: languageName: node linkType: hard -"url-parse@npm:^1.5.1": - version: 1.5.1 - resolution: "url-parse@npm:1.5.1" - dependencies: - querystringify: ^2.1.1 - requires-port: ^1.0.0 - checksum: d8342b597bf1760c4b9e3c78458524d783fa1c901658f3db8b576fc73451c89e6686d218ddca4845b082a63b23971b4a8b916cccc91f4156cc9f97ffdabe0079 - languageName: node - linkType: hard - "url-to-options@npm:^1.0.1": version: 1.0.1 resolution: "url-to-options@npm:1.0.1" From 19f418d6e9d60ce50288d4a3e53f1285db53817a Mon Sep 17 00:00:00 2001 From: Michael Richardson Date: Wed, 7 Jul 2021 21:16:29 -0700 Subject: [PATCH 09/10] pr review adjustments --- .../Teams/js/src/actions/actionHelpers.ts | 9 +- tests/unit/packages/Teams/js/package.json | 7 +- tests/unit/packages/Teams/js/tests/utils.ts | 4 +- yarn.lock | 329 ++++++++---------- 4 files changed, 155 insertions(+), 194 deletions(-) diff --git a/packages/Teams/js/src/actions/actionHelpers.ts b/packages/Teams/js/src/actions/actionHelpers.ts index 66d1cec41c..429dcfbafa 100644 --- a/packages/Teams/js/src/actions/actionHelpers.ts +++ b/packages/Teams/js/src/actions/actionHelpers.ts @@ -35,10 +35,7 @@ export function getValue( * BotFrameworkAdapter and TestAdapter contain them, so we just need to make sure that dc.context.adapter contains * an adapter with the appropriate auth methods. */ -export interface HasAuthMethods { - getUserToken: typeof BotFrameworkAdapter.prototype.getUserToken; - getSignInLink: typeof BotFrameworkAdapter.prototype.getSignInLink; -} +export type HasAuthMethods = Pick; /** * Test to assert val has required auth methods. @@ -60,9 +57,7 @@ export const testAdapterHasAuthMethods: Test = ( * This is similar to HasAuthMethods, but purely for testing since TestAdapter does not have * createConnectorClient, but BotFrameworkAdapter does. */ -export interface HasCreateConnectorClientMethod { - createConnectorClient: typeof BotFrameworkAdapter.prototype.createConnectorClient; -} +export type HasCreateConnectorClientMethod = Pick; /** * Test to assert val has required createConnectorClient method. diff --git a/tests/unit/packages/Teams/js/package.json b/tests/unit/packages/Teams/js/package.json index 442b041014..5d23a35710 100644 --- a/tests/unit/packages/Teams/js/package.json +++ b/tests/unit/packages/Teams/js/package.json @@ -8,9 +8,10 @@ "dependencies": { "@microsoft/bot-components-teams": "workspace:packages/Teams/js", "@types/mocha": "^8.2.2", - "botbuilder": "^4.14.0", - "botbuilder-dialogs-adaptive": "^4.14.0-preview", - "botframework-connector": "^4.14.0", + "botbuilder": "4.14.0", + "botbuilder-dialogs-adaptive": "4.14.0-preview", + "botbuilder-dialogs-adaptive-testing": "4.14.0-preview", + "botframework-connector": "4.14.0", "mocha": "^9.0.2", "nock": "^13.1.1", "ts-node": "^10.0.0" diff --git a/tests/unit/packages/Teams/js/tests/utils.ts b/tests/unit/packages/Teams/js/tests/utils.ts index 72e3263717..8998dbef16 100644 --- a/tests/unit/packages/Teams/js/tests/utils.ts +++ b/tests/unit/packages/Teams/js/tests/utils.ts @@ -11,12 +11,12 @@ import { ResourceExplorer, ResourceExplorerOptions, } from 'botbuilder-dialogs-declarative'; -import { AdaptiveTeamsBotComponent } from '@microsoft/bot-components-teams'; import path from 'path'; +import { BotComponent } from 'botbuilder'; export function makeResourceExplorer( resourceFolder: string, - ...botComponents: typeof AdaptiveTeamsBotComponent[] + ...botComponents: Array BotComponent> ): ResourceExplorer { const services = new ServiceCollection({ declarativeTypes: [], diff --git a/yarn.lock b/yarn.lock index 75c54ab1bb..8580535007 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,6 +5,35 @@ __metadata: version: 4 cacheKey: 7 +"@azure/abort-controller@npm:^1.0.0": + version: 1.0.4 + resolution: "@azure/abort-controller@npm:1.0.4" + dependencies: + tslib: ^2.0.0 + checksum: e772f6c9afd2c448260f08ef796e4ff73348c5dfd100ce557cf73dd08d7664e819f11f8e59c19a76daa46c1b271ce3061db23072c2150b112df655d38e82944b + languageName: node + linkType: hard + +"@azure/cognitiveservices-luis-runtime@npm:2.0.0": + version: 2.0.0 + resolution: "@azure/cognitiveservices-luis-runtime@npm:2.0.0" + dependencies: + "@azure/ms-rest-js": ^1.6.0 + tslib: ^1.9.3 + checksum: 15d51d16a707a29e9e72e74e96a4227f43a76e12e920328a8f5c7ebb41c711ac11a9676035b2410a198ba9f0007521f650ebd0046709677b557755327a41a325 + languageName: node + linkType: hard + +"@azure/core-auth@npm:^1.1.4": + version: 1.3.2 + resolution: "@azure/core-auth@npm:1.3.2" + dependencies: + "@azure/abort-controller": ^1.0.0 + tslib: ^2.2.0 + checksum: 66c7d074b55e15ecf75c2de64841693c680c326c969dd037bc3800674b658ae1d1b717975c543a34de2da1a1eb1410983d7d2f96ad1d26b61f0372d9214feeb7 + languageName: node + linkType: hard + "@azure/ms-rest-js@npm:1.9.1": version: 1.9.1 resolution: "@azure/ms-rest-js@npm:1.9.1" @@ -21,6 +50,22 @@ __metadata: languageName: node linkType: hard +"@azure/ms-rest-js@npm:^1.6.0": + version: 1.11.2 + resolution: "@azure/ms-rest-js@npm:1.11.2" + dependencies: + "@azure/core-auth": ^1.1.4 + axios: ^0.21.1 + form-data: ^2.3.2 + tough-cookie: ^2.4.3 + tslib: ^1.9.2 + tunnel: 0.0.6 + uuid: ^3.2.1 + xml2js: ^0.4.19 + checksum: a96f2f075ecbef968ad85606087ad8a1d40382d4b9581d184049c46027f2d470b6b669d5dfec722545f54b10e75f8d60ea5a950a69393bc8c431ec81dd5f561b + languageName: node + linkType: hard + "@babel/code-frame@npm:7.12.11": version: 7.12.11 resolution: "@babel/code-frame@npm:7.12.11" @@ -132,9 +177,10 @@ __metadata: dependencies: "@microsoft/bot-components-teams": "workspace:packages/Teams/js" "@types/mocha": ^8.2.2 - botbuilder: ^4.14.0 - botbuilder-dialogs-adaptive: ^4.14.0-preview - botframework-connector: ^4.14.0 + botbuilder: 4.14.0 + botbuilder-dialogs-adaptive: 4.14.0-preview + botbuilder-dialogs-adaptive-testing: 4.14.0-preview + botframework-connector: 4.14.0 mocha: ^9.0.2 nock: ^13.1.1 ts-node: ^10.0.0 @@ -939,34 +985,6 @@ __metadata: languageName: node linkType: hard -"adaptive-expressions@npm:4.14.0-rc2": - version: 4.14.0-rc2 - resolution: "adaptive-expressions@npm:4.14.0-rc2" - 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 - atob-lite: ^2.0.0 - big-integer: ^1.6.48 - btoa-lite: ^1.0.0 - 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: 97e1680fdc7d71614104bea5ba7a1cd4127967911688f5c287e30511f848f66b996df099412bb89ab668a81544662fa4c7e4c4822a3a512fddfc892715099193 - languageName: node - linkType: hard - "ajv@npm:^6.10.0, ajv@npm:^6.12.3, ajv@npm:^6.12.4": version: 6.12.6 resolution: "ajv@npm:6.12.6" @@ -1649,6 +1667,13 @@ __metadata: languageName: node linkType: hard +"bitwise@npm:^2.0.4": + version: 2.1.0 + resolution: "bitwise@npm:2.1.0" + checksum: 51c7ae49c2c109444c6aafaf221b86c8caf10c60c3ac0316b0cb1a76d12c8af383170bec22863bdd378ac05730a145a0026a9ce1fe2ff4925dc75c3288e45011 + languageName: node + linkType: hard + "bl@npm:^4.1.0": version: 4.1.0 resolution: "bl@npm:4.1.0" @@ -1660,31 +1685,37 @@ __metadata: languageName: node linkType: hard -"botbuilder-core@npm:4.14.0": +"botbuilder-ai@npm:4.14.0": version: 4.14.0 - resolution: "botbuilder-core@npm:4.14.0" + resolution: "botbuilder-ai@npm:4.14.0" dependencies: + "@azure/cognitiveservices-luis-runtime": 2.0.0 + "@azure/ms-rest-js": 1.9.1 + adaptive-expressions: 4.14.0 + botbuilder-core: 4.14.0 + botbuilder-dialogs: 4.14.0 botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview + botbuilder-dialogs-declarative: 4.14.0-preview botbuilder-stdlib: 4.14.0-internal - botframework-connector: 4.14.0 - botframework-schema: 4.14.0 - uuid: ^8.3.2 + lodash: ^4.17.21 + node-fetch: ^2.6.0 + url-parse: ^1.5.1 zod: ~1.11.17 - checksum: b617e7fea0120460113d59062cdf12f7903eea36d7941089dfe55aae3ba4abf8b3990e09273d76a584095303c972712762a0d87263360f7b4eab3e2c5ed6e017 + checksum: 1da331cc766169cf5b1a2ecca9e8c242ad51eced86656bafc134f3a53683aedb26d8bd1806e43ec14be2bba1950abbd7ef8a389b686f6d4e6339fb9eb2588f38 languageName: node linkType: hard -"botbuilder-core@npm:4.14.0-rc2": - version: 4.14.0-rc2 - resolution: "botbuilder-core@npm:4.14.0-rc2" +"botbuilder-core@npm:4.14.0": + version: 4.14.0 + resolution: "botbuilder-core@npm:4.14.0" dependencies: - botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview.rc2 - botbuilder-stdlib: 4.14.0-internal.rc2 - botframework-connector: 4.14.0-rc2 - botframework-schema: 4.14.0-rc2 + botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview + botbuilder-stdlib: 4.14.0-internal + botframework-connector: 4.14.0 + botframework-schema: 4.14.0 uuid: ^8.3.2 zod: ~1.11.17 - checksum: 6a0a55bb576bdfb60e67d5779e7a663db9c546ef5520d75718e30389ddb0d6291fcdc7e7df104ba0443304b28ffe363d41a31ae961d59447be85328a02285cdf + checksum: b617e7fea0120460113d59062cdf12f7903eea36d7941089dfe55aae3ba4abf8b3990e09273d76a584095303c972712762a0d87263360f7b4eab3e2c5ed6e017 languageName: node linkType: hard @@ -1697,12 +1728,23 @@ __metadata: languageName: node linkType: hard -"botbuilder-dialogs-adaptive-runtime-core@npm:4.14.0-preview.rc2": - version: 4.14.0-preview.rc2 - resolution: "botbuilder-dialogs-adaptive-runtime-core@npm:4.14.0-preview.rc2" +"botbuilder-dialogs-adaptive-testing@npm:4.14.0-preview": + version: 4.14.0-preview + resolution: "botbuilder-dialogs-adaptive-testing@npm:4.14.0-preview" dependencies: - dependency-graph: ^0.10.0 - checksum: ae23051cb664122f4f40ab5753a1655f34b6b06596bba25d347b3c877dfc986de5da8c30680946a154afc3925f6c9ab4d4ff286821306e570429380d0839dda8 + adaptive-expressions: 4.14.0 + bitwise: ^2.0.4 + botbuilder-ai: 4.14.0 + botbuilder-core: 4.14.0 + botbuilder-dialogs: 4.14.0 + botbuilder-dialogs-adaptive: 4.14.0-preview + botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview + botbuilder-dialogs-declarative: 4.14.0-preview + botbuilder-stdlib: 4.14.0-internal + murmurhash-js: ^1.0.0 + nock: ^11.9.1 + url-parse: ^1.5.1 + checksum: 6bff035cf41273596df50a0755026a34a7b55ae31af21d2c0574b961e84d3622ae545a74db296de7df533f028daa96c563ba70df3dc864b291cccce35d4c61d2 languageName: node linkType: hard @@ -1723,23 +1765,6 @@ __metadata: languageName: node linkType: hard -"botbuilder-dialogs-adaptive@npm:^4.14.0-preview": - version: 4.14.0-preview.rc2 - resolution: "botbuilder-dialogs-adaptive@npm:4.14.0-preview.rc2" - dependencies: - "@microsoft/recognizers-text-suite": 1.1.4 - adaptive-expressions: 4.14.0-rc2 - botbuilder: 4.14.0-rc2 - botbuilder-dialogs: 4.14.0-rc2 - botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview.rc2 - botbuilder-dialogs-declarative: 4.14.0-preview.rc2 - botbuilder-lg: 4.14.0-rc2 - lodash: ^4.17.21 - node-fetch: ^2.6.0 - checksum: 59ac133abad4fd91cf45b06de5ffc08d9839f2196d393d4f40f9863fb0a731b009bfd8df98985b066ba64e1050745a9422a7bbfbc762eb9e2c200b9ee8b05f3d - languageName: node - linkType: hard - "botbuilder-dialogs-declarative@npm:4.14.0-preview": version: 4.14.0-preview resolution: "botbuilder-dialogs-declarative@npm:4.14.0-preview" @@ -1752,18 +1777,6 @@ __metadata: languageName: node linkType: hard -"botbuilder-dialogs-declarative@npm:4.14.0-preview.rc2": - version: 4.14.0-preview.rc2 - resolution: "botbuilder-dialogs-declarative@npm:4.14.0-preview.rc2" - dependencies: - botbuilder-core: 4.14.0-rc2 - botbuilder-dialogs: 4.14.0-rc2 - botbuilder-stdlib: 4.14.0-internal.rc2 - chokidar: ^3.4.0 - checksum: 65c685b15e7a9257bef4a0f8481f274909c10c2db93a2f72040ed66aa1c1e937c07ef389754e37e3f40a08e816eb85a76843c16f39b8dd4f1ae8aae221fec3ec - languageName: node - linkType: hard - "botbuilder-dialogs@npm:4.14.0": version: 4.14.0 resolution: "botbuilder-dialogs@npm:4.14.0" @@ -1783,25 +1796,6 @@ __metadata: languageName: node linkType: hard -"botbuilder-dialogs@npm:4.14.0-rc2": - version: 4.14.0-rc2 - resolution: "botbuilder-dialogs@npm:4.14.0-rc2" - 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.14.0-rc2 - botbuilder-dialogs-adaptive-runtime-core: 4.14.0-preview.rc2 - botbuilder-stdlib: 4.14.0-internal.rc2 - botframework-connector: 4.14.0-rc2 - globalize: ^1.4.2 - lodash: ^4.17.21 - zod: ~1.11.17 - checksum: 552f8f244a5b3109071d8e930fd24ff08a5063db4d92005350e1e99ddd41a1dd159c6dedd739f9f76653d3b61f00f16e2d67d3c6176bc2a29cd17ce0a36395b8 - languageName: node - linkType: hard - "botbuilder-lg@npm:4.14.0": version: 4.14.0 resolution: "botbuilder-lg@npm:4.14.0" @@ -1814,18 +1808,6 @@ __metadata: languageName: node linkType: hard -"botbuilder-lg@npm:4.14.0-rc2": - version: 4.14.0-rc2 - resolution: "botbuilder-lg@npm:4.14.0-rc2" - dependencies: - adaptive-expressions: 4.14.0-rc2 - antlr4ts: 0.5.0-alpha.3 - lodash: ^4.17.19 - uuid: ^8.3.2 - checksum: 28f2fd8d6fba0a2feb9887773034a42c4bf730cd4c414a33a5d6bdde795c7a4231a27750e8cdef29a0a5d24b418ce0d9252ebc326e07b337b0181aed9bd0776b - languageName: node - linkType: hard - "botbuilder-stdlib@npm:4.14.0-internal": version: 4.14.0-internal resolution: "botbuilder-stdlib@npm:4.14.0-internal" @@ -1833,14 +1815,7 @@ __metadata: languageName: node linkType: hard -"botbuilder-stdlib@npm:4.14.0-internal.rc2": - version: 4.14.0-internal.rc2 - resolution: "botbuilder-stdlib@npm:4.14.0-internal.rc2" - checksum: fa437e8cc3d689901ff3a24276e64d7de998a5ce573793b28e026c0dc13631fb391ad7464367049da0e3249bc6a6f0b5a76392c013f351d9b97f6e2454030f07 - languageName: node - linkType: hard - -"botbuilder@npm:4.14.0, botbuilder@npm:^4.14.0": +"botbuilder@npm:4.14.0": version: 4.14.0 resolution: "botbuilder@npm:4.14.0" dependencies: @@ -1860,27 +1835,7 @@ __metadata: languageName: node linkType: hard -"botbuilder@npm:4.14.0-rc2": - version: 4.14.0-rc2 - resolution: "botbuilder@npm:4.14.0-rc2" - dependencies: - "@azure/ms-rest-js": 1.9.1 - axios: ^0.21.1 - botbuilder-core: 4.14.0-rc2 - botbuilder-stdlib: 4.14.0-internal.rc2 - botframework-connector: 4.14.0-rc2 - botframework-streaming: 4.14.0-rc2 - dayjs: ^1.10.3 - filenamify: ^4.1.0 - fs-extra: ^7.0.1 - htmlparser2: ^6.0.1 - uuid: ^8.3.2 - zod: ~1.11.17 - checksum: 324beaa09fb3870a03247f6b76925c05f1c61d7b193184c71f55dcb5abf2f1efe1edebe3da84a0e182af7b3534b6273c4390e89faf282036f7a8e2a5d2dc3a35 - languageName: node - linkType: hard - -"botframework-connector@npm:4.14.0, botframework-connector@npm:^4.14.0": +"botframework-connector@npm:4.14.0": version: 4.14.0 resolution: "botframework-connector@npm:4.14.0" dependencies: @@ -1899,25 +1854,6 @@ __metadata: languageName: node linkType: hard -"botframework-connector@npm:4.14.0-rc2": - version: 4.14.0-rc2 - resolution: "botframework-connector@npm:4.14.0-rc2" - dependencies: - "@azure/ms-rest-js": 1.9.1 - "@types/jsonwebtoken": 7.2.8 - "@types/node": ^10.17.27 - adal-node: 0.2.2 - axios: ^0.21.1 - base64url: ^3.0.0 - botbuilder-stdlib: 4.14.0-internal.rc2 - botframework-schema: 4.14.0-rc2 - cross-fetch: ^3.0.5 - jsonwebtoken: 8.0.1 - rsa-pem-from-mod-exp: ^0.8.4 - checksum: 188c646db252281469786ee5964c394897995ef74ca604df14dead099a8681db77c2477e2928f5af5c532e7aba1e0b0ed4c24dfefe34d819f676e9ac6e71120d - languageName: node - linkType: hard - "botframework-schema@npm:4.14.0": version: 4.14.0 resolution: "botframework-schema@npm:4.14.0" @@ -1928,16 +1864,6 @@ __metadata: languageName: node linkType: hard -"botframework-schema@npm:4.14.0-rc2": - version: 4.14.0-rc2 - resolution: "botframework-schema@npm:4.14.0-rc2" - dependencies: - botbuilder-stdlib: 4.14.0-internal.rc2 - uuid: ^8.3.2 - checksum: 580a64fc1ebf6141497ed832025908f29a19b4dfafcb2a4b39897d6e66cab4696f793cb13ce8c0a5ea5138c47ecc9b595f49d6d01dac9159982124e2b7656541 - languageName: node - linkType: hard - "botframework-streaming@npm:4.14.0": version: 4.14.0 resolution: "botframework-streaming@npm:4.14.0" @@ -1950,18 +1876,6 @@ __metadata: languageName: node linkType: hard -"botframework-streaming@npm:4.14.0-rc2": - version: 4.14.0-rc2 - resolution: "botframework-streaming@npm:4.14.0-rc2" - dependencies: - "@types/node": ^10.17.27 - "@types/ws": ^6.0.3 - uuid: ^8.3.2 - ws: ^7.1.2 - checksum: e069264b1adb922a3aee3ee3bee3962d46a8db5176a29a5ab121f96b88b9294af59fa1176d10d85f344bc6c5ccac0c01bd29614617e49aa00e2e69a387788e84 - languageName: node - linkType: hard - "brace-expansion@npm:^1.1.7": version: 1.1.11 resolution: "brace-expansion@npm:1.1.11" @@ -6439,7 +6353,7 @@ fsevents@^1.2.3: languageName: node linkType: hard -"lodash@npm:^4.17.10, lodash@npm:^4.17.11, lodash@npm:^4.17.14, lodash@npm:^4.17.15, lodash@npm:^4.17.19, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.17.4, lodash@npm:^4.3.0": +"lodash@npm:^4.17.10, lodash@npm:^4.17.11, lodash@npm:^4.17.13, lodash@npm:^4.17.14, lodash@npm:^4.17.15, lodash@npm:^4.17.19, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.17.4, lodash@npm:^4.3.0": version: 4.17.21 resolution: "lodash@npm:4.17.21" checksum: 4983720b9abca930a4a46f18db163d7dad8dd00dbed6db0cc7b499b33b717cce69f80928b27bbb1ff2cbd3b19d251ee90669a8b5ea466072ca81c2ebe91e7468 @@ -7041,6 +6955,13 @@ fsevents@^1.2.3: languageName: node linkType: hard +"murmurhash-js@npm:^1.0.0": + version: 1.0.0 + resolution: "murmurhash-js@npm:1.0.0" + checksum: 7b0f02796fde7a6fe0e41ed3197b758e6824f33b284a5cbdcca0942e629d34309a4e344760204ad5503dc1d75f9ba7574b72406ac654dc56ab69f22b1e9ee821 + languageName: node + linkType: hard + "mute-stream@npm:0.0.7": version: 0.0.7 resolution: "mute-stream@npm:0.0.7" @@ -7148,6 +7069,19 @@ fsevents@^1.2.3: languageName: node linkType: hard +"nock@npm:^11.9.1": + version: 11.9.1 + resolution: "nock@npm:11.9.1" + dependencies: + debug: ^4.1.0 + json-stringify-safe: ^5.0.1 + lodash: ^4.17.13 + mkdirp: ^0.5.0 + propagate: ^2.0.0 + checksum: 4cbbe7ee50d7a1514c60dfdbd40e10b9ec51035b8f0282dbb1bdd795ae2dd6d8612713b5edcf7fb1034f2d6b4449f672be71880702f1f5d36e06b0e718731ffc + languageName: node + linkType: hard + "nock@npm:^13.1.1": version: 13.1.1 resolution: "nock@npm:13.1.1" @@ -8049,6 +7983,13 @@ fsevents@^1.2.3: languageName: node linkType: hard +"querystringify@npm:^2.1.1": + version: 2.2.0 + resolution: "querystringify@npm:2.2.0" + checksum: 6235036be3aedff7919dfc06b23f759264915c5794c6352d52a917401d40d2b9bb43b1d82e4e5be983e469aa320e06992aefc218192f6fa1d9eba4f54dc4786c + languageName: node + linkType: hard + "queue-microtask@npm:^1.2.2": version: 1.2.2 resolution: "queue-microtask@npm:1.2.2" @@ -8398,6 +8339,13 @@ fsevents@^1.2.3: languageName: node linkType: hard +"requires-port@npm:^1.0.0": + version: 1.0.0 + resolution: "requires-port@npm:1.0.0" + checksum: 0db25fb2ac9b4f2345a350846b7ba99d1f25a6686b1728246d14f05450c8f2fc066bdfae4561b4be2627c184a030a27e17268cfefdf46836e271db13734bc49e + languageName: node + linkType: hard + "resolve-cwd@npm:^2.0.0": version: 2.0.0 resolution: "resolve-cwd@npm:2.0.0" @@ -9585,13 +9533,20 @@ resolve@1.1.7: languageName: node linkType: hard -"tslib@npm:^1.8.1, tslib@npm:^1.9.0, tslib@npm:^1.9.2": +"tslib@npm:^1.8.1, tslib@npm:^1.9.0, tslib@npm:^1.9.2, tslib@npm:^1.9.3": version: 1.14.1 resolution: "tslib@npm:1.14.1" checksum: f44fe7f216946b17d3e3074df3746372703cf24e9127b4c045511456e8e4bf25515fb0a1bb3937676cc305651c5d4fcb6377b0588a4c6a957e748c4c28905d17 languageName: node linkType: hard +"tslib@npm:^2.0.0, tslib@npm:^2.2.0": + version: 2.3.0 + resolution: "tslib@npm:2.3.0" + checksum: 7b4fc9feff0f704743c3760f5d8d708f6417fac6458159e63df3a6b1100f0736e3b99edb9fe370f274ad15160a1f49ff05cb49402534c818ff552c48e38c3e6e + languageName: node + linkType: hard + "tsutils@npm:^3.21.0": version: 3.21.0 resolution: "tsutils@npm:3.21.0" @@ -9820,6 +9775,16 @@ typescript@^4.0.5: languageName: node linkType: hard +"url-parse@npm:^1.5.1": + version: 1.5.1 + resolution: "url-parse@npm:1.5.1" + dependencies: + querystringify: ^2.1.1 + requires-port: ^1.0.0 + checksum: d8342b597bf1760c4b9e3c78458524d783fa1c901658f3db8b576fc73451c89e6686d218ddca4845b082a63b23971b4a8b916cccc91f4156cc9f97ffdabe0079 + languageName: node + linkType: hard + "url-to-options@npm:^1.0.1": version: 1.0.1 resolution: "url-to-options@npm:1.0.1" From 99ce61de31b82a2129e78461878e98cc7681ee61 Mon Sep 17 00:00:00 2001 From: Michael Richardson Date: Wed, 7 Jul 2021 21:23:47 -0700 Subject: [PATCH 10/10] lint fix --- .eslintrc.json | 3 ++- packages/Teams/js/package.json | 1 + packages/Teams/js/src/actions/actionHelpers.ts | 10 ++++++++-- yarn.lock | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index d21952753f..5bcc487e97 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -8,6 +8,7 @@ "plugins": ["prettier"], "rules": { "prettier/prettier": "error" - } + }, + "root": true } diff --git a/packages/Teams/js/package.json b/packages/Teams/js/package.json index 34f16b2d7d..1dc2ed2a17 100644 --- a/packages/Teams/js/package.json +++ b/packages/Teams/js/package.json @@ -53,6 +53,7 @@ "botbuilder-stdlib": "4.14.0-internal", "botframework-connector": "4.14.0", "eslint": "^7.30.0", + "eslint-plugin-prettier": "latest", "lodash": "^4.17.21", "rimraf": "^3.0.2", "typescript": "^4.0.5" diff --git a/packages/Teams/js/src/actions/actionHelpers.ts b/packages/Teams/js/src/actions/actionHelpers.ts index 429dcfbafa..32dfc8fe38 100644 --- a/packages/Teams/js/src/actions/actionHelpers.ts +++ b/packages/Teams/js/src/actions/actionHelpers.ts @@ -35,7 +35,10 @@ export function getValue( * BotFrameworkAdapter and TestAdapter contain them, so we just need to make sure that dc.context.adapter contains * an adapter with the appropriate auth methods. */ -export type HasAuthMethods = Pick; +export type HasAuthMethods = Pick< + BotFrameworkAdapter, + 'getUserToken' | 'getSignInLink' +>; /** * Test to assert val has required auth methods. @@ -57,7 +60,10 @@ export const testAdapterHasAuthMethods: Test = ( * This is similar to HasAuthMethods, but purely for testing since TestAdapter does not have * createConnectorClient, but BotFrameworkAdapter does. */ -export type HasCreateConnectorClientMethod = Pick; +export type HasCreateConnectorClientMethod = Pick< + BotFrameworkAdapter, + 'createConnectorClient' +>; /** * Test to assert val has required createConnectorClient method. diff --git a/yarn.lock b/yarn.lock index 8580535007..cf061aa36e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -204,6 +204,7 @@ __metadata: botbuilder-stdlib: 4.14.0-internal botframework-connector: 4.14.0 eslint: ^7.30.0 + eslint-plugin-prettier: latest lodash: ^4.17.21 rimraf: ^3.0.2 typescript: ^4.0.5