diff --git a/go-app-ussd_tb_check.js b/go-app-ussd_tb_check.js index bad4576a..edcea705 100644 --- a/go-app-ussd_tb_check.js +++ b/go-app-ussd_tb_check.js @@ -1327,7 +1327,6 @@ go.app = function () { .post(self.im.config.healthcheck.url + "/v1/tbactivationstatus", payload) .then( function (response) { - console.log("Response: ", response); // Get activation status var is_active = response.data.is_activation_active; @@ -1577,7 +1576,7 @@ go.app = function () { new Choice("state_end", $("Exit")), ]; - if (activation === "tb_study_a"){ + if (activation === "tb_study_a" || activation === "tb_study_b" || activation === "tb_study_c"){ choice_list = [ new Choice("state_research_consent", $("Back")), new Choice("state_end", $("Exit")), diff --git a/src/ussd_tb_check.js b/src/ussd_tb_check.js index 8fe8a14a..19aee999 100644 --- a/src/ussd_tb_check.js +++ b/src/ussd_tb_check.js @@ -1210,7 +1210,6 @@ go.app = function () { .post(self.im.config.healthcheck.url + "/v1/tbactivationstatus", payload) .then( function (response) { - console.log("Response: ", response); // Get activation status var is_active = response.data.is_activation_active; @@ -1460,7 +1459,7 @@ go.app = function () { new Choice("state_end", $("Exit")), ]; - if (activation === "tb_study_a"){ + if (activation === "tb_study_a" || activation === "tb_study_b" || activation === "tb_study_c"){ choice_list = [ new Choice("state_research_consent", $("Back")), new Choice("state_end", $("Exit")), diff --git a/test/ussd_tb_check.test.js b/test/ussd_tb_check.test.js index cf615d55..4bdd2686 100644 --- a/test/ussd_tb_check.test.js +++ b/test/ussd_tb_check.test.js @@ -921,6 +921,27 @@ describe("ussd_tb_check app", function () { .check.user.state("state_suburb_name") .run(); }); + it("should show state_research_consent for back option", function () { + return tester.setup.user + .state("state_sms_complete") + .inputs({ session_event: "continue", to_addr: "*123*123*3#" }) + .check.interaction({ + state: "state_sms_complete", + reply:[ + "The FAQ has been sent to you by SMS. What would you like to do?", + "1. Back", + "2. Exit"].join("\n"), + char_limit: 160, + }) + .run(); + }); + it("should show state_research_consent for back option", function () { + return tester.setup.user + .state("state_sms_complete") + .inputs("1") + .check.user.state("state_survey_start") + .run(); + }); }); describe("state_city", function () { it("should ask for the city", function () {