Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Engineering] Lower time for botbuilder-testing tests #2631

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 5 additions & 21 deletions libraries/botbuilder-testing/tests/dialogTestClient.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,15 @@ describe('DialogTestClient', function() {
assert(client.dialogTurnResult.status == DialogTurnStatus.complete, 'dialog did not end properly');
});

it('should process a single turn waterfall dialog', async function() {

let dialog = new WaterfallDialog('waterfall', [
async(step) => {
await step.context.sendActivity('hello');
return step.endDialog();
}
]);

let client = new DialogTestClient('test', dialog);
let reply = await client.sendActivity('hello');
assert(reply.text == 'hello', 'dialog responded with incorrect message');
assert(reply.channelId == 'test', 'test channel id didnt get set');
assert(client.dialogTurnResult.status == DialogTurnStatus.complete, 'dialog did not end properly');
});

it('should process a 2 turn waterfall dialog', async function() {

let dialog = new WaterfallDialog('waterfall', [
async(step) => {
async (step) => {
await step.context.sendActivity('hello');
await step.context.sendActivity({type: 'typing'});
return step.next();
},
async(step) => {
async (step) => {
await step.context.sendActivity('hello 2');
return step.endDialog();
},
Expand All @@ -85,10 +69,10 @@ describe('DialogTestClient', function() {
super(id);

let dialog = new WaterfallDialog('waterfall', [
async(step) => {
async (step) => {
return step.prompt('textPrompt', 'Tell me something');
},
async(step) => {
async (step) => {
await step.context.sendActivity('you said: ' + step.result);
return step.next();
},
Expand Down Expand Up @@ -118,4 +102,4 @@ describe('DialogTestClient', function() {
assert(reply.text == 'you said: foo', 'dialog responded with incorrect 2nd message');
assert(client.dialogTurnResult.status == DialogTurnStatus.complete, 'dialog did not end properly');
});
});
});