release: opensource snapshot 2026-02-27 19:25:00

This commit is contained in:
saturn
2026-02-27 19:25:00 +08:00
commit 5de9622c8b
1055 changed files with 164772 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import { describe, expect, it } from 'vitest'
import { formatExternalId, parseExternalId } from '@/lib/async-poll'
describe('async poll externalId contract', () => {
it('parses standard FAL externalId with endpoint', () => {
const parsed = parseExternalId('FAL:VIDEO:fal-ai/wan/v2.6/image-to-video:req_123')
expect(parsed.provider).toBe('FAL')
expect(parsed.type).toBe('VIDEO')
expect(parsed.endpoint).toBe('fal-ai/wan/v2.6/image-to-video')
expect(parsed.requestId).toBe('req_123')
})
it('rejects legacy non-standard externalId formats', () => {
expect(() => parseExternalId('FAL:fal-ai/wan/v2.6/image-to-video:req_123')).toThrow(/无效 FAL externalId/)
expect(() => parseExternalId('batches/legacy')).toThrow(/无法识别的 externalId 格式/)
})
it('requires endpoint when formatting FAL externalId', () => {
expect(() => formatExternalId('FAL', 'VIDEO', 'req_123')).toThrow(/requires endpoint/)
})
})