优化各元素输入框中的启发提示文本
音效、背景音乐和图标素材改为空值加灰色启发提示。 角色规范、图标规范和自定义规范输入框补充灰色启发提示。 同步更新相关前端组件测试。
This commit is contained in:
@@ -161,6 +161,13 @@ describe('ImageCanvasSpecGenerationPanelView', () => {
|
||||
onUpdateSpecFormValue: updateSpecFormValue,
|
||||
});
|
||||
|
||||
expect(
|
||||
(screen.getByLabelText('玩法设定') as HTMLInputElement).placeholder,
|
||||
).toBe('这是什么类型的游戏?');
|
||||
expect(
|
||||
(screen.getByLabelText('美术风格') as HTMLInputElement).placeholder,
|
||||
).toBe('游戏的画风是怎样的?');
|
||||
|
||||
fireEvent.change(screen.getByLabelText('玩法设定'), {
|
||||
target: { value: '战棋玩法' },
|
||||
});
|
||||
@@ -183,6 +190,34 @@ describe('ImageCanvasSpecGenerationPanelView', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('uses gameplay and art style hints for icon specs', () => {
|
||||
renderPanel({
|
||||
dialog: createSpecDialog({
|
||||
specType: 'ui',
|
||||
specValues: {
|
||||
playSetting: '',
|
||||
artStyle: '',
|
||||
bodyRatio: '3',
|
||||
characterView: '右向斜侧身站姿',
|
||||
customPrompt: '',
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
expect((screen.getByLabelText('玩法设定') as HTMLInputElement).value).toBe(
|
||||
'',
|
||||
);
|
||||
expect(
|
||||
(screen.getByLabelText('玩法设定') as HTMLInputElement).placeholder,
|
||||
).toBe('这是什么类型的游戏?');
|
||||
expect((screen.getByLabelText('美术风格') as HTMLInputElement).value).toBe(
|
||||
'',
|
||||
);
|
||||
expect(
|
||||
(screen.getByLabelText('美术风格') as HTMLInputElement).placeholder,
|
||||
).toBe('游戏的画风是怎样的?');
|
||||
});
|
||||
|
||||
it('renders custom prompt and hides reference upload for icon specs', () => {
|
||||
const updateSpecFormValue = vi.fn();
|
||||
renderPanel({
|
||||
@@ -199,6 +234,13 @@ describe('ImageCanvasSpecGenerationPanelView', () => {
|
||||
onUpdateSpecFormValue: updateSpecFormValue,
|
||||
});
|
||||
|
||||
const customPrompt = screen.getByLabelText(
|
||||
'自定义规范提示词',
|
||||
) as HTMLTextAreaElement;
|
||||
expect(customPrompt.placeholder).toBe(
|
||||
'写下你想要的任何内容,陶泥儿帮你形成新的约束',
|
||||
);
|
||||
|
||||
fireEvent.change(screen.getByLabelText('自定义规范提示词'), {
|
||||
target: { value: '新的规范提示' },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user