fix: align partner media with production CMS data

This commit is contained in:
syntaxbullet
2026-07-13 12:14:37 +02:00
parent d6f8f55c09
commit 818f283e10
12 changed files with 93 additions and 262 deletions

View File

@@ -0,0 +1,13 @@
import { describe, expect, it } from 'vitest'
import { mediaUrl, normalizeMediaUrl } from '@/spa/cmsMediaField'
describe('CMS media URLs', () => {
it('preserves Payload file endpoints used by production', () => {
expect(normalizeMediaUrl('/api/media/file/image%20(26).jpg')).toBe('/api/media/file/image%20(26).jpg')
})
it('builds a Payload file endpoint when only a filename is populated', () => {
expect(mediaUrl({ filename: 'image (26).jpg' }, '')).toBe('/api/media/file/image%20(26).jpg')
})
})