LifeMate — Personal, Family & Learning Companion
test: verify guardian family guidance privacy boundary
davoodmehraban89 committed
Oct 5, 2026 at 16:25 UTC
32e1831232e2ee1be06cf8b096b0ffd2df11e460
1 file changed
+24
backend/tests/phase4.test.js
+24
@@ -176,6 +176,30 @@ test('phase 4 learning wellbeing and guardian safety boundaries', async () => {
176
);
177
assert.equal(outsiderSummary.status, 403);
178
179
+ const familyGuidance = await request(
180
+ `/v1/families/${family.body.id}/children/${teen.userId}/family-guidance`,
181
+ {
182
+ method: 'POST',
183
+ token: parent.token,
184
+ body: { question: 'چطور بدون فشار حمایتش کنم؟' },
185
+ },
186
+ );
187
+ assert.equal(familyGuidance.status, 200);
188
+ assert.equal(familyGuidance.body.advisory, true);
189
+ assert.equal(familyGuidance.body.medicalDiagnosis, false);
190
+ assert.equal(familyGuidance.body.rawNotesIncluded, false);
191
+ assert.equal(familyGuidance.body.rawConversationIncluded, false);
192
+
193
+ const outsiderGuidance = await request(
194
+ `/v1/families/${family.body.id}/children/${teen.userId}/family-guidance`,
195
+ {
196
+ method: 'POST',
197
+ token: outsider.token,
198
+ body: { question: 'وضعیت چیست؟' },
199
+ },
200
+ );
201
+ assert.equal(outsiderGuidance.status, 403);
202
+
203
const session = await request('/v1/ai/sessions', {
204
method: 'POST',
205
token: teen.token,