first commit

This commit is contained in:
wsq
2026-05-13 21:58:19 +08:00
commit 0167c66cb7
1475 changed files with 233414 additions and 0 deletions
@@ -0,0 +1,20 @@
import { describe, expect, it } from 'vitest'
import { buildProjectLocationGenerateImageBody } from '@/lib/query/mutations/location-image-mutations'
describe('buildProjectLocationGenerateImageBody', () => {
it('includes artStyle when generating a project location image', () => {
expect(buildProjectLocationGenerateImageBody({
projectId: 'project-1',
locationId: 'location-1',
count: 1,
artStyle: 'japanese-anime',
})).toEqual({
scope: 'project',
kind: 'location',
projectId: 'project-1',
imageIndex: undefined,
count: 1,
artStyle: 'japanese-anime',
})
})
})
@@ -0,0 +1,55 @@
import { describe, expect, it } from 'vitest'
import { createEmptyAssetGroupMap } from '@/lib/assets/grouping'
import { mapAssetGroupsToProjectAssetsData } from '@/lib/query/hooks/useProjectAssets'
describe('useProjectAssets adapters', () => {
it('preserves profileData for unconfirmed character profiles', () => {
const groups = createEmptyAssetGroupMap()
groups.character.push({
id: 'character-1',
scope: 'project',
kind: 'character',
family: 'visual',
name: '林夏',
folderId: null,
capabilities: {
canGenerate: true,
canSelectRender: true,
canRevertRender: true,
canModifyRender: true,
canUploadRender: true,
canBindVoice: true,
canCopyFromGlobal: true,
},
taskRefs: [],
taskState: {
isRunning: false,
lastError: null,
},
variants: [],
introduction: '主角',
profileData: JSON.stringify({ archetype: 'lead' }),
profileConfirmed: false,
profileTaskRefs: [],
profileTaskState: {
isRunning: false,
lastError: null,
},
voice: {
voiceType: null,
voiceId: null,
customVoiceUrl: null,
media: null,
},
})
const data = mapAssetGroupsToProjectAssetsData(groups)
expect(data.characters).toHaveLength(1)
expect(data.characters[0]).toEqual(expect.objectContaining({
id: 'character-1',
profileData: JSON.stringify({ archetype: 'lead' }),
profileConfirmed: false,
}))
})
})