[pn] stub endpoint

This commit is contained in:
Devin Zuczek
2026-08-19 17:35:38 -04:00
parent 6916ed2557
commit 6add3437cf
2 changed files with 34 additions and 0 deletions
@@ -112,3 +112,19 @@ it('401s the preferences read without a bearer token', async () => {
expect(res.status).toBe(401)
expect(await res.text()).toBe('')
})
it('serves the callers CRM config', async () => {
const res = await SELF.fetch(`${ORIGIN}/crm/me/config/v3`, { headers: await bearer('205') })
expect(res.status).toBe(200)
expect(res.headers.get('content-type')).toContain('application/json')
// Empty rather than invented: there is no CRM behind this, and made-up keys would switch
// on client messaging paths with nothing to serve them.
expect(await res.json()).toEqual({})
})
it('401s the CRM config read without a bearer token', async () => {
// `me`-scoped, so it needs a token even though the answer is the same for everyone.
const res = await SELF.fetch(`${ORIGIN}/crm/me/config/v3`)
expect(res.status).toBe(401)
expect(await res.text()).toBe('')
})