- Timestamp:
- 07/28/2026 10:45:26 AM (6 weeks ago)
- Branches:
- main
- Children:
- d9ad6c5
- Parents:
- 65abc85
- File:
-
- 1 edited
-
test/gated-settings.test.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
test/gated-settings.test.js
r65abc85 r2708282 61 61 assert.equal(featureColumn('external_embeds = 1; DROP TABLE sites'), null); 62 62 }); 63 64 // Guard against the mistake that made the button do nothing: the route called 65 // AP.deliverTo, which existed only as a key in the guardianship deps object and 66 // not as an export. It threw a TypeError, Express answered 500, and the button 67 // silently reset. A grep hit is not an export. 68 test('the guardian route can reach every ActivityPub helper it calls', async () => { 69 const AP = (await import('../src/services/ActivityPubService.js')).default; 70 for (const fn of ['actorId', 'deliverToActor', 'followActor', 'backfillFromOutbox', 'getTimeline']) { 71 assert.equal(typeof AP[fn], 'function', `AP.${fn} must be exported, the guardian route calls it`); 72 } 73 }); 74 75 test('a gated-setting Offer carries ward, feature and value', async () => { 76 const { buildGatedOffer, parseGatedSetting } = await import('../src/services/guardianship/gated.js'); 77 const o = buildGatedOffer('https://a/gated/1', 'https://a/g1', 'https://b/ward', 'shaer:externalEmbeds', true); 78 assert.equal(o.type, 'Offer'); 79 assert.deepEqual(o.to, ['https://b/ward'], 'addressed to the ward server, which tallies'); 80 const parsed = parseGatedSetting(o.object); 81 assert.deepEqual(parsed, { ward: 'https://b/ward', feature: 'shaer:externalEmbeds', value: true }); 82 assert.equal(parseGatedSetting({ type: 'Relationship' }), null, 'a different Offer is not ours'); 83 });
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)