#267 Add minimum Immich version to prevent this issue
This commit is contained in:
@@ -134,9 +134,10 @@ describe('album timeline enumeration (Immich 3.0)', () => {
|
||||
expect(result.valid).toBe(false)
|
||||
})
|
||||
|
||||
it('does not crash when an individual share returns no assets array (#267)', async () => {
|
||||
// Immich 3.0.x can return an INDIVIDUAL shared link with no `assets` key.
|
||||
// `.filter` of undefined used to reject and take the container down.
|
||||
it('treats a share with no assets array as empty', async () => {
|
||||
// Defensive guard (see #267): if Immich returns a link whose `assets`
|
||||
// isn't an array, `.filter` of undefined would reject and, unhandled,
|
||||
// exit the whole process. Treat it as an empty share instead.
|
||||
const noAssets = { type: 'INDIVIDUAL', key: 'real-key', allowDownload: true }
|
||||
vi.stubGlobal('fetch', vi.fn(async (url: string) => {
|
||||
if (url.includes('/shared-links/me')) return jsonResponse(noAssets)
|
||||
|
||||
Reference in New Issue
Block a user