@@ -467,22 +467,6 @@ describe(`BotFrameworkAdapter`, function () {
467
467
} ) ;
468
468
} ) ;
469
469
470
- it ( `should continueConversation().` , function ( done ) {
471
- let called = false ;
472
- const adapter = new AdapterUnderTest ( ) ;
473
- adapter . continueConversation ( reference , ( context ) => {
474
- assert ( context , `context not passed.` ) ;
475
- assert ( context . activity , `context has no request.` ) ;
476
- assert ( context . activity . type === 'event' , `request has invalid type.` ) ;
477
- assert ( context . activity . from && context . activity . from . id === reference . user . id , `request has invalid from.id.` ) ;
478
- assert ( context . activity . recipient && context . activity . recipient . id === reference . bot . id , `request has invalid recipient.id.` ) ;
479
- called = true ;
480
- } ) . then ( ( ) => {
481
- assert ( called , `bot logic not called.` ) ;
482
- done ( ) ;
483
- } ) ;
484
- } ) ;
485
-
486
470
it ( `should createConversation().` , function ( done ) {
487
471
let called = false ;
488
472
const adapter = new AdapterUnderTest ( ) ;
@@ -1198,6 +1182,56 @@ describe(`BotFrameworkAdapter`, function () {
1198
1182
} ) ;
1199
1183
1200
1184
describe ( 'continueConversation' , function ( ) {
1185
+ it ( `should succeed.` , function ( done ) {
1186
+ let called = false ;
1187
+ const adapter = new AdapterUnderTest ( ) ;
1188
+ adapter . continueConversation ( reference , ( context ) => {
1189
+ assert ( context , `context not passed.` ) ;
1190
+ assert ( context . activity , `context has no request.` ) ;
1191
+ assert ( context . activity . type === 'event' , `request has invalid type.` ) ;
1192
+ assert ( context . activity . from && context . activity . from . id === reference . user . id , `request has invalid from.id.` ) ;
1193
+ assert ( context . activity . recipient && context . activity . recipient . id === reference . bot . id , `request has invalid recipient.id.` ) ;
1194
+ called = true ;
1195
+ } ) . then ( ( ) => {
1196
+ assert ( called , `bot logic not called.` ) ;
1197
+ done ( ) ;
1198
+ } ) ;
1199
+ } ) ;
1200
+
1201
+ it ( `should not trust reference.serviceUrl if there is no AppId on the credentials.` , function ( done ) {
1202
+ let called = false ;
1203
+ const adapter = new AdapterUnderTest ( ) ;
1204
+ adapter . continueConversation ( reference , ( context ) => {
1205
+ assert ( context , `context not passed.` ) ;
1206
+ assert ( context . activity , `context has no request.` ) ;
1207
+ assert ( context . activity . type === 'event' , `request has invalid type.` ) ;
1208
+ assert ( context . activity . from && context . activity . from . id === reference . user . id , `request has invalid from.id.` ) ;
1209
+ assert ( context . activity . recipient && context . activity . recipient . id === reference . bot . id , `request has invalid recipient.id.` ) ;
1210
+ assert ( ! MicrosoftAppCredentials . isTrustedServiceUrl ( 'https://example.org/channel' ) ) ;
1211
+ called = true ;
1212
+ } ) . then ( ( ) => {
1213
+ assert ( called , `bot logic not called.` ) ;
1214
+ done ( ) ;
1215
+ } ) ;
1216
+ } ) ;
1217
+
1218
+ it ( `should trust reference.serviceUrl if there is an AppId on the credentials.` , function ( done ) {
1219
+ let called = false ;
1220
+ const adapter = new AdapterUnderTest ( { appId : '2id' , appPassword : '2pw' } ) ;
1221
+ adapter . continueConversation ( reference , ( context ) => {
1222
+ assert ( context , `context not passed.` ) ;
1223
+ assert ( context . activity , `context has no request.` ) ;
1224
+ assert ( context . activity . type === 'event' , `request has invalid type.` ) ;
1225
+ assert ( context . activity . from && context . activity . from . id === reference . user . id , `request has invalid from.id.` ) ;
1226
+ assert ( context . activity . recipient && context . activity . recipient . id === reference . bot . id , `request has invalid recipient.id.` ) ;
1227
+ assert ( MicrosoftAppCredentials . isTrustedServiceUrl ( 'https://example.org/channel' ) ) ;
1228
+ called = true ;
1229
+ } ) . then ( ( ) => {
1230
+ assert ( called , `bot logic not called.` ) ;
1231
+ done ( ) ;
1232
+ } ) ;
1233
+ } ) ;
1234
+
1201
1235
it ( `should work with oAuthScope and logic passed in.` , async ( ) => {
1202
1236
let called = false ;
1203
1237
const adapter = new AdapterUnderTest ( ) ;
0 commit comments