feat(attachments): downloadable attachments in ProvenancePanel + PostInfoHeader

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-19 11:17:14 -04:00
parent 74e34d359b
commit cba662a900
4 changed files with 51 additions and 2 deletions
+14
View File
@@ -59,4 +59,18 @@ describe('provenance store', () => {
expect(globalThis.fetch.mock.calls.length).toBe(1)
expect(store.postInfo(3).data.artist.slug).toBe('a')
})
it('loadForImage keeps attachments from the payload', async () => {
const store = useProvenanceStore()
stubFetch(() => ({
status: 200,
body: {
image_id: 1, provenance: [],
attachments: [{ id: 9, original_filename: 'p.zip', size_bytes: 5,
ext: '.zip', download_url: '/api/attachments/9/download' }]
}
}))
await store.loadForImage(1)
expect(store.imageProv(1).attachments[0].id).toBe(9)
})
})