- Timestamp:
- 08/03/2026 06:26:57 AM (5 weeks ago)
- Branches:
- main
- Children:
- 30d0e2c
- Parents:
- 5327324
- File:
-
- 1 edited
-
test/guardianship.test.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
test/guardianship.test.js
r5327324 r69bd747 160 160 const stillPending = G.offersCollection(`${SAM}/queues/offers`, 'sam', SAM).orderedItems.filter((o) => o.id === id); 161 161 assert.deepEqual(stillPending, [], 'the handshake is void, not left hanging'); 162 }); 163 164 test('an Offer from a candidate that is already a ward is refused on arrival (§4.2)', async () => { 165 // The kind path. Nobody has accepted anything yet, so refusing here 166 // discloses nothing about anyone's position, and a candidate who is merely 167 // misconfigured gets told what is wrong while that is still all it means. 168 const viv = site('s13', 'viv'); // adopted first, then tries to guard 169 const zed = site('s14', 'zed'); // the would-be ward 170 const bo = site('s15', 'bo'); // adopts Viv 171 const [VIV, ZED, BO] = [A('viv'), A('zed'), A('bo')]; 172 173 const adopt = await G.handleGuardianshipOutbox(bo, { 174 type: 'Offer', object: { type: 'Relationship', subject: VIV, relationship: 'shaer:Guardian', object: BO }, 175 }); 176 await G.handleGuardianshipOutbox(viv, { type: 'Accept', object: adopt.id }); 177 assert.equal(G.listGuardians('viv').length, 1, 'Viv is a ward'); 178 179 const handled = await G.handleGuardianshipInbox(zed, { 180 id: `${VIV}/offers/x1`, type: 'Offer', actor: VIV, to: [ZED], 181 object: { type: 'Relationship', subject: ZED, relationship: 'shaer:Guardian', object: VIV }, 182 }); 183 assert.equal(handled, true, 'the activity is handled — and handling it means refusing it'); 184 assert.deepEqual( 185 G.offersCollection(`${ZED}/queues/offers`, 'zed', ZED).orderedItems, [], 186 'never stored, so it never sits in Zed\'s queue looking like a decision to make', 187 ); 188 assert.deepEqual(G.listGuardians('zed'), []); 162 189 }); 163 190
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)