合并主分支
解决简单冲突
This commit is contained in:
@@ -1098,32 +1098,35 @@ describe('ImageCanvasGenerationSubmissionModel', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('uses 5 seconds as default game sound effect duration', () => {
|
||||
it('uses the game sound effect fallback for an all-whitespace prompt', () => {
|
||||
const plan = buildImageGenerationSubmissionPlan({
|
||||
dialog: {
|
||||
mode: 'audio-sound-effect',
|
||||
prompt: '按钮确认短促音',
|
||||
prompt: ' \t\r\n ',
|
||||
status: 'idle',
|
||||
},
|
||||
layers: [],
|
||||
nextGeneratedIndex: 6,
|
||||
});
|
||||
|
||||
expect(plan).toMatchObject({
|
||||
expect(plan).toEqual({
|
||||
kind: 'audio',
|
||||
audioKind: 'sound-effect',
|
||||
normalizedPrompt: '游戏音效',
|
||||
input: {
|
||||
prompt: '按钮确认短促音',
|
||||
prompt: '游戏音效',
|
||||
model: 'audio1.0',
|
||||
duration: 5,
|
||||
},
|
||||
result: {
|
||||
title: '游戏音效 6',
|
||||
generationInputs: {
|
||||
fields: [
|
||||
{ title: 'prompt', value: '按钮确认短促音' },
|
||||
{ title: 'prompt', value: '游戏音效' },
|
||||
{ title: 'model', value: 'audio1.0' },
|
||||
{ title: '时长', value: '5秒' },
|
||||
],
|
||||
references: [],
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -1133,19 +1136,20 @@ describe('ImageCanvasGenerationSubmissionModel', () => {
|
||||
const plan = buildImageGenerationSubmissionPlan({
|
||||
dialog: {
|
||||
mode: 'audio-background-music',
|
||||
prompt: ' 温暖轻快的森林冒险背景音乐 ',
|
||||
prompt: '不会进入正式请求的旧值',
|
||||
status: 'idle',
|
||||
},
|
||||
layers: [],
|
||||
nextGeneratedIndex: 5,
|
||||
canonicalBackgroundMusicPrompt: '\uFEFF温暖轻快的森林冒险背景音乐\uFEFF',
|
||||
});
|
||||
|
||||
expect(plan).toEqual({
|
||||
kind: 'audio',
|
||||
audioKind: 'background-music',
|
||||
normalizedPrompt: '温暖轻快的森林冒险背景音乐',
|
||||
normalizedPrompt: '\uFEFF温暖轻快的森林冒险背景音乐\uFEFF',
|
||||
input: {
|
||||
gptDescriptionPrompt: '温暖轻快的森林冒险背景音乐',
|
||||
gptDescriptionPrompt: '\uFEFF温暖轻快的森林冒险背景音乐\uFEFF',
|
||||
makeInstrumental: true,
|
||||
},
|
||||
result: {
|
||||
@@ -1154,7 +1158,7 @@ describe('ImageCanvasGenerationSubmissionModel', () => {
|
||||
fields: [
|
||||
{
|
||||
title: 'gpt_description_prompt',
|
||||
value: '温暖轻快的森林冒险背景音乐',
|
||||
value: '\uFEFF温暖轻快的森林冒险背景音乐\uFEFF',
|
||||
},
|
||||
],
|
||||
references: [],
|
||||
@@ -1162,4 +1166,18 @@ describe('ImageCanvasGenerationSubmissionModel', () => {
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('does not build a background music plan without a claimed canonical prompt', () => {
|
||||
expect(() =>
|
||||
buildImageGenerationSubmissionPlan({
|
||||
dialog: {
|
||||
mode: 'audio-background-music',
|
||||
prompt: ' 不应原生 trim 或回退默认值 ',
|
||||
status: 'idle',
|
||||
},
|
||||
layers: [],
|
||||
nextGeneratedIndex: 1,
|
||||
}),
|
||||
).toThrow('背景音乐提交缺少已确认的提示词');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user