Skip to content

Commit

Permalink
feat: add miscellany context; closes evanp#169
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Prodromou <git@evanprodromou.name>
  • Loading branch information
Evan Prodromou committed May 4, 2024
1 parent a033b95 commit 359619b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ const SEC_CONTEXT = 'https://w3id.org/security'
const BLOCKED_CONTEXT = 'https://purl.archive.org/socialweb/blocked'
const PENDING_CONTEXT = 'https://purl.archive.org/socialweb/pending'
const WEBFINGER_CONTEXT = 'https://purl.archive.org/socialweb/webfinger'
const CONTEXT = [AS_CONTEXT, SEC_CONTEXT, BLOCKED_CONTEXT, PENDING_CONTEXT, WEBFINGER_CONTEXT]
const MISCELLANY_CONTEXT = 'https://purl.archive.org/socialweb/miscellany'
const CONTEXT = [AS_CONTEXT, SEC_CONTEXT, BLOCKED_CONTEXT, PENDING_CONTEXT, WEBFINGER_CONTEXT, MISCELLANY_CONTEXT]

const LD_MEDIA_TYPE = 'application/ld+json'
const ACTIVITY_MEDIA_TYPE = 'application/activity+json'
Expand Down
16 changes: 15 additions & 1 deletion index.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5081,7 +5081,7 @@ describe('onepage.pub', { only: true }, () => {
})
})

describe('Actor has webfinger property', { only: true }, () => {
describe('Actor has webfinger property', () => {
let actor1 = null
before(async () => {
[actor1] = await registerActor()
Expand All @@ -5097,4 +5097,18 @@ describe('onepage.pub', { only: true }, () => {
assert.strictEqual(obj.webfinger, `${actor1.preferredUsername}@localhost:${MAIN_PORT}`)
})
})

describe('Actor has miscellany context', { only: true }, () => {
let actor1 = null
before(async () => {
[actor1] = await registerActor()
})
it('Actor has miscellany context', { only: true }, async () => {
const obj = await getObject(actor1.id)
assert.strictEqual(typeof obj, 'object')
assert('@context' in obj)
assert(Array.isArray(obj['@context']))
assert(obj['@context'].includes('https://purl.archive.org/socialweb/miscellany'))
})
})
})

0 comments on commit 359619b

Please sign in to comment.