LifeMate — Personal, Family & Learning Companion
test: align phase 4 contract checks with completed implementation
davoodmehraban89 committed
Oct 5, 2026 at 16:17 UTC
b6739fdb787f18504de7a4e9f7342b5ca941c627
1 file changed
+2
-2
backend/tests/phase4_contract.test.js
+2
-2
@@ -6,13 +6,13 @@ const src=fs.readFileSync(new URL('../src/phase4.js',import.meta.url),'utf8');
6
const migration=fs.readFileSync(new URL('../migrations/0004_ai_learning_wellbeing.sql',import.meta.url),'utf8');
7
8
test('phase4 schema contains learning wellbeing guide and proposal boundaries',()=>{
9
- for(const table of ['learning_goal','learning_checkin','wellbeing_checkin','ai_guide_session','ai_guide_message','ai_plan_proposal']) assert.match(migration,new RegExp(`create table if not exists ${table}`));
9
+ for(const table of ['learning_goal','learning_checkin','wellbeing_checkin','ai_guide_session','ai_guide_message','ai_plan_proposal','wellbeing_safety_event']) assert.match(migration,new RegExp(`create table if not exists ${table}`));
10
assert.match(migration,/visibility in \('private','guardian_summary'\)/);
11
assert.match(migration,/status in \('proposed','accepted','rejected'\)/);
12
});
13
14
test('AI guide is advisory and has urgent safety path',()=>{
15
- assert.match(src,/urgent_review/); assert.match(src,/medicalDiagnosis:false/); assert.match(src,/automaticAction:false/); assert.match(src,/خدمات اضطراری محلی/);
15
+ assert.match(src,/urgent_review/); assert.match(src,/medicalDiagnosis:\s*false/); assert.match(src,/automaticAction:\s*false/); assert.match(src,/خدمات اضطراری محلی/);
16
});
17
18
test('wellbeing list is owner scoped and excludes raw note',()=>{