From b36f9c959159920d00492ca346edebf35675c0af Mon Sep 17 00:00:00 2001 From: Buhle Date: Wed, 15 Nov 2023 13:52:39 +0200 Subject: [PATCH 1/2] removed a log to see the response --- go-app-ussd_tb_check.js | 1 - src/ussd_tb_check.js | 1 - 2 files changed, 2 deletions(-) diff --git a/go-app-ussd_tb_check.js b/go-app-ussd_tb_check.js index bad4576a..ba05c80e 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; diff --git a/src/ussd_tb_check.js b/src/ussd_tb_check.js index 8fe8a14a..7903f6a6 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; From 926958f17def3e2e93834d9be4960b7380ea5ef7 Mon Sep 17 00:00:00 2001 From: Buhle Date: Wed, 15 Nov 2023 16:58:19 +0200 Subject: [PATCH 2/2] fix bug of screen after FAQ sms --- go-app-ussd_tb_check.js | 2 +- src/ussd_tb_check.js | 2 +- test/ussd_tb_check.test.js | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/go-app-ussd_tb_check.js b/go-app-ussd_tb_check.js index ba05c80e..edcea705 100644 --- a/go-app-ussd_tb_check.js +++ b/go-app-ussd_tb_check.js @@ -1576,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 7903f6a6..19aee999 100644 --- a/src/ussd_tb_check.js +++ b/src/ussd_tb_check.js @@ -1459,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 () {