Skip to content

Commit

Permalink
port: do nothing when activity is null (#3421)
Browse files Browse the repository at this point in the history
Fixes #3417
  • Loading branch information
joshgummersall authored Mar 24, 2021
1 parent adfb64d commit c18d387
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,10 @@ describe('ActionTests', function () {
await TestUtils.runTestScript(resourceExplorer, 'Action_TextInputWithValueExpression');
});

it('TextInputWithInvalidResponse', async () => {
await TestUtils.runTestScript(resourceExplorer, 'Action_TextInputWithInvalidResponse');
});

it('TextInputWithNonStringInput', async () => {
await TestUtils.runTestScript(resourceExplorer, 'Action_TextInputWithNonStringInput');
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"$schema": "../../../../schemas/sdk.schema",
"$kind": "Microsoft.Test.Script",
"dialog": {
"$kind": "Microsoft.AdaptiveDialog",
"id": "planningTest",
"triggers": [
{
"$kind": "Microsoft.OnUnknownIntent",
"actions": [
{
"$kind": "Microsoft.TextInput",
"property": "user.name",
"prompt": "Hello, what is your name?",
"unrecognizedPrompt": "How should I call you?",
"invalidPrompt": "That does not soud like a name",
"defaultValue": "somevalue",
"defaultValueResponse": "",
"maxTurnCount": 1,
"validations": [
"this.value.Length > 3"
]
},
{
"$kind": "Microsoft.SendActivity",
"activity": "nice to meet you!"
}
]
}
],
"autoEndDialog": true,
"defaultResultProperty": "dialog.result"
},
"script": [
{
"$kind": "Microsoft.Test.UserSays",
"text": "hi"
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "Hello, what is your name?"
},
{
"$kind": "Microsoft.Test.UserSays",
"text": "c"
},
{
"$kind": "Microsoft.Test.AssertReply",
"text": "nice to meet you!"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ export abstract class InputDialog extends Dialog implements InputDialogConfigura
},
});

await dc.context.sendActivity(response);
if (response != null) {
await dc.context.sendActivity(response);
}
}

const property = this.property.getValue(dc.state);
Expand Down

0 comments on commit c18d387

Please sign in to comment.