Skip to content

Commit

Permalink
Default province to blank value
Browse files Browse the repository at this point in the history
  • Loading branch information
Buhle79 committed Oct 10, 2023
1 parent 7338006 commit 1bb7d96
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 21 deletions.
13 changes: 4 additions & 9 deletions go-app-ussd_tb_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ go.app = function () {
var next_state = "state_tracing";
var activation = self.im.user.answers.activation;

if (activation === "tb_study_b" || activation === "tb_study_c"){
if (activation === "tb_study_a" || activation === "tb_study_b" || activation === "tb_study_c"){
next_state = "state_study_tracing";
}

Expand All @@ -886,11 +886,6 @@ go.app = function () {

self.add("state_tracing", function (name) {
var next_state = "state_opt_in";
var activation = self.im.user.answers.activation;

if (activation === "tb_study_b" || activation === "tb_study_c"){
next_state = "state_submit_data";
}

var question = $(
"Now, please agree that the info you shared is correct and that you give " +
Expand Down Expand Up @@ -921,7 +916,7 @@ go.app = function () {
var next_state = "state_opt_in";
var activation = self.im.user.answers.activation;

if (activation === "tb_study_b" || activation === "tb_study_c"){
if (activation === "tb_study_a" || activation === "tb_study_b" || activation === "tb_study_c"){
next_state = "state_submit_data";
}

Expand Down Expand Up @@ -976,7 +971,7 @@ go.app = function () {
var msisdn = utils.normalize_msisdn(self.im.user.addr, "ZA");
var activation = self.get_activation();

if (activation === "tb_study_b" || activation === "tb_study_c"){
if (activation === "tb_study_a" || activation === "tb_study_b" || activation === "tb_study_c"){
self.im.user.answers.state_tracing = answers.state_study_tracing;
}

Expand All @@ -985,7 +980,7 @@ go.app = function () {
msisdn: msisdn,
source: "USSD",
language: answers.state_language,
province: answers.state_province ? answers.state_province : "ZA-WC",
province: answers.state_province ? answers.state_province : "",
city: answers.state_city ? answers.state_city : "<not collected>",
age: answers.state_age,
gender: answers.state_gender,
Expand Down
13 changes: 4 additions & 9 deletions src/ussd_tb_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ go.app = function () {
var next_state = "state_tracing";
var activation = self.im.user.answers.activation;

if (activation === "tb_study_b" || activation === "tb_study_c"){
if (activation === "tb_study_a" || activation === "tb_study_b" || activation === "tb_study_c"){
next_state = "state_study_tracing";
}

Expand All @@ -769,11 +769,6 @@ go.app = function () {

self.add("state_tracing", function (name) {
var next_state = "state_opt_in";
var activation = self.im.user.answers.activation;

if (activation === "tb_study_b" || activation === "tb_study_c"){
next_state = "state_submit_data";
}

var question = $(
"Now, please agree that the info you shared is correct and that you give " +
Expand Down Expand Up @@ -804,7 +799,7 @@ go.app = function () {
var next_state = "state_opt_in";
var activation = self.im.user.answers.activation;

if (activation === "tb_study_b" || activation === "tb_study_c"){
if (activation === "tb_study_a" || activation === "tb_study_b" || activation === "tb_study_c"){
next_state = "state_submit_data";
}

Expand Down Expand Up @@ -859,7 +854,7 @@ go.app = function () {
var msisdn = utils.normalize_msisdn(self.im.user.addr, "ZA");
var activation = self.get_activation();

if (activation === "tb_study_b" || activation === "tb_study_c"){
if (activation === "tb_study_a" || activation === "tb_study_b" || activation === "tb_study_c"){
self.im.user.answers.state_tracing = answers.state_study_tracing;
}

Expand All @@ -868,7 +863,7 @@ go.app = function () {
msisdn: msisdn,
source: "USSD",
language: answers.state_language,
province: answers.state_province ? answers.state_province : "ZA-WC",
province: answers.state_province ? answers.state_province : "",
city: answers.state_city ? answers.state_city : "<not collected>",
age: answers.state_age,
gender: answers.state_gender,
Expand Down
6 changes: 3 additions & 3 deletions test/ussd_tb_check.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1627,7 +1627,7 @@ describe("ussd_tb_check app", function () {
.state("state_exposure")
.setup.user.answer("activation", "tb_study_a")
.input("1")
.check.user.state("state_tracing")
.check.user.state("state_study_tracing")
.run();
});
it("should go to state_study_tracing for tb_study_b ", function () {
Expand Down Expand Up @@ -2522,7 +2522,7 @@ describe("ussd_tb_check app", function () {
});
});
describe("state_no_province", function () {
it("go to state_complete for valid answer and assign to ZA-WC for null province", function () {
it("go to state_complete for valid answer and assign to blank for null province", function () {
return tester.setup.user
.state("state_opt_in")
.setup.user.answers({
Expand All @@ -2547,7 +2547,7 @@ describe("ussd_tb_check app", function () {
msisdn: "+27123456789",
source: "USSD",
language: "eng",
province: "ZA-WC",
province: "",
city: "JHB",
age: "<18",
gender: "male",
Expand Down

0 comments on commit 1bb7d96

Please sign in to comment.