feat(web): annotation result copy matches policy-driven ingestion
Saved strategies now report intents/fetch/planned/blocked counts and point at 解析监控 → 待入库; the blocked note explains the 需下架 lane instead of the deprecated snapshot-diff confirmation step.
This commit is contained in:
@@ -36,11 +36,11 @@ describe('source catalog API',()=>{
|
||||
it('routes selected files without exposing target knowledge-base IDs to the browser',async()=>{
|
||||
const fetchMock=vi.fn()
|
||||
.mockResolvedValueOnce(new Response(JSON.stringify({data:{internal_enabled:true,external_enabled:true}})))
|
||||
.mockResolvedValueOnce(new Response(JSON.stringify({data:{selected_files:2,routable_files:2,unbound_files:0,hash_unknown_files:0,unavailable_files:0}})))
|
||||
.mockResolvedValueOnce(new Response(JSON.stringify({data:{selected_files:2,intents_recorded:2,fetch_queued:1,planned_publications:4,blocked_items:0,unbound_files:0}})))
|
||||
vi.stubGlobal('fetch',fetchMock)
|
||||
expect((await fetchCatalogRoutingCapabilities()).internal_enabled).toBe(true)
|
||||
const result=await routeCatalogFiles({connection_id:'conn-1',node_ids:['a','b'],policy:'both',reason:'批量标注'})
|
||||
expect(result.routable_files).toBe(2)
|
||||
expect(result.planned_publications).toBe(4)
|
||||
expect(result.unbound_files).toBe(0)
|
||||
const payload=JSON.parse(fetchMock.mock.calls[1][1].body)
|
||||
expect(payload.policy).toBe('both')
|
||||
@@ -49,11 +49,12 @@ describe('source catalog API',()=>{
|
||||
expect(fetchMock.mock.calls[1][1].headers).toMatchObject({Accept:'application/json','Content-Type':'application/json','Idempotency-Key':expect.any(String)})
|
||||
expect(fetchMock.mock.calls[1][1].headers['Idempotency-Key']).not.toBe('')
|
||||
})
|
||||
it('returns the number of test-knowledge removals requested by a blocked policy',async()=>{
|
||||
const fetchMock=vi.fn().mockResolvedValue(new Response(JSON.stringify({data:{selected_files:2,routable_files:0,unbound_files:2,hash_unknown_files:0,unavailable_files:0}})))
|
||||
it('reports blocked items without planning anything',async()=>{
|
||||
const fetchMock=vi.fn().mockResolvedValue(new Response(JSON.stringify({data:{selected_files:2,intents_recorded:2,fetch_queued:0,planned_publications:0,blocked_items:2,unbound_files:0}})))
|
||||
vi.stubGlobal('fetch',fetchMock)
|
||||
const result=await routeCatalogFiles({connection_id:'conn-1',node_ids:['a','b'],policy:'blocked',reason:'禁止导入'})
|
||||
expect(result.unbound_files).toBe(2)
|
||||
expect(result.blocked_items).toBe(2)
|
||||
expect(result.planned_publications).toBe(0)
|
||||
})
|
||||
it('starts a durable background refresh job with no source credential payload',async()=>{
|
||||
const job={id:'job-refresh',type:'source.catalog.refresh',payload:{connection_id:'conn-1',stage:'queued',progress:0,message:'等待后台刷新'},state:'pending',priority:20,available_at:'2026-09-09T00:00:00Z',attempt:0,max_attempts:3,idempotency_key:'safe',created_at:'2026-09-09T00:00:00Z',updated_at:'2026-09-09T00:00:00Z'}
|
||||
|
||||
Reference in New Issue
Block a user