Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
rename ivr (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
Edgar Cruzado authored Jan 21, 2021
1 parent 6919fac commit d0c8094
Show file tree
Hide file tree
Showing 3 changed files with 221 additions and 233 deletions.
6 changes: 3 additions & 3 deletions bin/bst-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ const questions = [
value: "google",
},
{
name: "IVR",
value: "twilio",
name: "Phone",
value: "phone",
},
],
},
{
type: "input",
name: "phoneNumber",
message: "Please provide a valid phone number in the E.164 format to call to (e.g.: +14155552671):",
when: (answers: any) => answers["platform"].includes("twilio"),
when: (answers: any) => answers["platform"].includes("phone"),
validate: (input: any) => {
if (!input) return false;
return /^\+?[1-9]\d{1,14}$/.test(input);
Expand Down
10 changes: 5 additions & 5 deletions lib/init/init-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class InitUtil {
description: this.getTestSuiteDescription(type),
};
const interactions = [this.getLaunchInteraction(type, platform)];
if (platform !== "twilio") {
if (platform !== "phone") {
interactions.push(this.getHelpInteraction(type, platform));
}
const yamlObject = {
Expand Down Expand Up @@ -146,7 +146,7 @@ export class InitUtil {
input = "LaunchRequest";
expected = `Welcome to ${this.projectName}`;
} else if (type === "e2e") {
if (platform === "twilio") {
if (platform === "phone") {
input = "$DIAL";
expected = `Welcome to ${this.projectName}`;
} else {
Expand All @@ -162,7 +162,7 @@ export class InitUtil {
"value": expected,
},
];
if (platform === "twilio") {
if (platform === "phone") {
expectedItems.push({
"action": "set finishOnPhrase",
"operator": ":",
Expand Down Expand Up @@ -236,8 +236,8 @@ export class InitUtil {
if (this.platform === "google") {
testingJsonForUnit["platform"] = "google";
testingJsonForUnit["dialogFlow"] = this.dialogFlow;
} else if (this.platform === "twilio") {
testingJsonForE2e["platform"] = "twilio";
} else if (this.platform === "phone") {
testingJsonForE2e["platform"] = "phone";
testingJsonForE2e["phoneNumber"] = this.phoneNumber;
}
return this.type === "unit" ? testingJsonForUnit : testingJsonForE2e;
Expand Down
Loading

0 comments on commit d0c8094

Please sign in to comment.