@davoodmehraban89 / LifeMate / commits / 505c110
Fork 0

LifeMate — Personal, Family & Learning Companion

test: fix phase 4 privacy assertion

davoodmehraban89 committed Oct 5, 2026 at 15:57 UTC 505c110f5d0a5cc95200efcf25465a54a5bdb84c
1 file changed +4 -7
backend/tests/phase4_contract.test.js
+4 -7
@@ -12,13 +12,10 @@ test('phase4 schema contains learning wellbeing guide and proposal boundaries',(
12 });
13
14 test('AI guide is advisory and has urgent safety path',()=>{
15 - assert.match(src,/urgent_review/);
16 - assert.match(src,/medicalDiagnosis:false/);
17 - assert.match(src,/automaticAction:false/);
18 - assert.match(src,/خدمات اضطراری محلی/);
15 + assert.match(src,/urgent_review/); assert.match(src,/medicalDiagnosis:false/); assert.match(src,/automaticAction:false/); assert.match(src,/خدمات اضطراری محلی/);
16 });
17
21 -test('wellbeing reads are owner scoped',()=>{
22 - assert.match(src,/wellbeing_checkin where owner_user_id=\$1/);
23 - assert.doesNotMatch(src,/guardian.*note/i);
18 +test('wellbeing list is owner scoped and excludes raw note',()=>{
19 + assert.match(src,/select id,mood,energy,stress,visibility,created_at from wellbeing_checkin where owner_user_id=\$1/);
20 + assert.doesNotMatch(src,/select id,mood,energy,stress,note,visibility,created_at from wellbeing_checkin/);
21 });