Skip to content

Commit

Permalink
changed check to user input for commit to test
Browse files Browse the repository at this point in the history
  • Loading branch information
Buhle79 committed Oct 18, 2023
1 parent 784c6c0 commit 27f9881
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions go-app-ussd_tb_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ go.app = function () {

var payload = {
data: {
commit_get_tested: answers.state_commit_to_get_tested ? "yes" : "no",
commit_get_tested: answers.state_commit_to_get_tested === "state_commit_to_get_tested_yes" ? "yes" : "no",
"source": "USSD",
clinic_visit_day: answers.clinic_visit_day,
},
Expand All @@ -1184,7 +1184,7 @@ go.app = function () {
.patch(self.im.config.healthcheck.url + "/v2/tbcheck/"+ id +"/", payload)
.then(
function () {
if (answers.state_commit_to_get_tested){
if (answers.state_commit_to_get_tested === "state_commit_to_get_tested_yes"){
return self.states.create("state_commitment");
}
else{
Expand Down
4 changes: 2 additions & 2 deletions src/ussd_tb_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ go.app = function () {

var payload = {
data: {
commit_get_tested: answers.state_commit_to_get_tested ? "yes" : "no",
commit_get_tested: answers.state_commit_to_get_tested === "state_commit_to_get_tested_yes" ? "yes" : "no",
"source": "USSD",
clinic_visit_day: answers.clinic_visit_day,
},
Expand All @@ -1067,7 +1067,7 @@ go.app = function () {
.patch(self.im.config.healthcheck.url + "/v2/tbcheck/"+ id +"/", payload)
.then(
function () {
if (answers.state_commit_to_get_tested){
if (answers.state_commit_to_get_tested === "state_commit_to_get_tested_yes"){
return self.states.create("state_commitment");
}
else{
Expand Down
4 changes: 2 additions & 2 deletions test/ussd_tb_check.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2122,7 +2122,7 @@ describe("ussd_tb_check app", function () {
.state("state_submit_test_commit")
.setup.user.answers({
tbcheck_id: 22,
state_commit_to_get_tested: true,
state_commit_to_get_tested: "state_commit_to_get_tested_yes",
})
.setup(function (api) {
api.http.fixtures.add({
Expand Down Expand Up @@ -2155,7 +2155,7 @@ describe("ussd_tb_check app", function () {
.state("state_submit_test_commit")
.setup.user.answers({
tbcheck_id: 22,
state_commit_to_get_tested: false,
state_commit_to_get_tested: "state_submit_test_commit",
})
.setup(function (api) {
api.http.fixtures.add({
Expand Down

0 comments on commit 27f9881

Please sign in to comment.