Skip to content

Commit

Permalink
Merge pull request #626 from praekeltfoundation/add_consent_test
Browse files Browse the repository at this point in the history
add test to check that research consent is undefined
  • Loading branch information
Hlamallama authored Nov 8, 2023
2 parents 9281752 + b0c2b48 commit bd496cc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go-app-ussd_tb_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ go.app = function () {
else{
payload.data.follow_up_optin = answers.state_opt_in;

if (answers.state_age === "state_gender"){
if (answers.state_age === "<18"){
payload.data.research_consent = false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ussd_tb_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ go.app = function () {
else{
payload.data.follow_up_optin = answers.state_opt_in;

if (answers.state_age === "state_gender"){
if (answers.state_age === "<18"){
payload.data.research_consent = false;
}
}
Expand Down
11 changes: 8 additions & 3 deletions test/ussd_tb_check.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1794,6 +1794,7 @@ describe("ussd_tb_check app", function () {
state_tracing: true,
state_exposure: "no",
state_language: "eng",

})
.setup(function (api) {
api.http.fixtures.add({
Expand All @@ -1817,8 +1818,10 @@ describe("ussd_tb_check app", function () {
follow_up_optin: true,
risk: "low",
activation: null,
research_consent: false,
data: {
tb_privacy_policy_accepted: "yes"
tb_privacy_policy_accepted: "yes",

}
},
},
Expand All @@ -1828,7 +1831,7 @@ describe("ussd_tb_check app", function () {
id: 20,
profile: {
accepted: true,
tbconnect_group_arm: "control",
research_consent: false,
},
},
},
Expand All @@ -1839,6 +1842,7 @@ describe("ussd_tb_check app", function () {
.run();
});
});

describe("state_complete", function () {
it("should say thanks for opt in", function () {
return tester.setup.user
Expand Down Expand Up @@ -2554,6 +2558,7 @@ describe("ussd_tb_check app", function () {
follow_up_optin: true,
risk: "low",
activation: null,
research_consent: false,
data: {
tb_privacy_policy_accepted: "yes"
}
Expand All @@ -2565,7 +2570,7 @@ describe("ussd_tb_check app", function () {
id: 20,
profile: {
accepted: true,
tbconnect_group_arm: "control",
research_consent: false,
},
},
},
Expand Down

0 comments on commit bd496cc

Please sign in to comment.