mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-27 19:34:38 +00:00
feat(agent): use deterministic storage keys for preset avatars (#404)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
getPresetAvatarBuffer,
|
||||
getPresetAvatarStorageKey,
|
||||
isPresetAvatarId,
|
||||
PRESET_AVATAR_IDS,
|
||||
type PresetAvatarId,
|
||||
@@ -27,6 +28,12 @@ describe('agent presets', () => {
|
||||
expect(getPresetAvatarBuffer('unknown' as PresetAvatarId)).toBeNull()
|
||||
})
|
||||
|
||||
it('returns deterministic storage key for preset avatars', () => {
|
||||
for (const id of PRESET_AVATAR_IDS) {
|
||||
expect(getPresetAvatarStorageKey(id)).toBe(`files/avatars/${id}.webp`)
|
||||
}
|
||||
})
|
||||
|
||||
it('provides AVAILABLE_AVATARS with 8 previews via dtos', async () => {
|
||||
const { AVAILABLE_AVATARS } = await import('@shumai/dtos')
|
||||
expect(AVAILABLE_AVATARS).toHaveLength(8)
|
||||
|
||||
Reference in New Issue
Block a user