Skip to content

Commit

Permalink
Merge pull request #630 from praekeltfoundation/TBH-749-dev-implement…
Browse files Browse the repository at this point in the history
…-phase-1-cap-2-250-7-day-cutoff

Tbh 749 dev implement phase 1 cap 2 250 7 day cutoff
  • Loading branch information
Buhle79 authored Nov 15, 2023
2 parents 2498fbc + 926958f commit f6f68f5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
3 changes: 1 addition & 2 deletions go-app-ussd_tb_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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")),
Expand Down
3 changes: 1 addition & 2 deletions src/ussd_tb_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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")),
Expand Down
21 changes: 21 additions & 0 deletions test/ussd_tb_check.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit f6f68f5

Please sign in to comment.