mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-10-05 21:05:39 +08:00
feat: 日报新增模板市场,支持社区模板安装与使用
This commit is contained in:
@@ -245,6 +245,28 @@ describe('Local API authentication', () => {
|
||||
expect(fixture.testSend).toHaveBeenCalledOnce()
|
||||
})
|
||||
|
||||
it('rejects external template refs on the legacy report HTTP API', async () => {
|
||||
const handle = await startFixtureServer()
|
||||
const response = await fetch(`${baseUrl(handle)}/api/v1/report`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: `Bearer ${VALID_TOKEN}`,
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
report: {},
|
||||
metadata: {},
|
||||
templateRef: { id: 'community.github.example.template', version: '1.0.0' }
|
||||
})
|
||||
})
|
||||
expect(response.status).toBe(400)
|
||||
await expect(response.json()).resolves.toMatchObject({
|
||||
status: 400,
|
||||
error: 'HTTP API 暂不支持外部日报模板,请使用内置 templateId',
|
||||
details: { code: 'external_template_unsupported' }
|
||||
})
|
||||
})
|
||||
|
||||
it.each([
|
||||
'http://localhost',
|
||||
'http://localhost:5173',
|
||||
|
||||
Reference in New Issue
Block a user