显示图标规范输入字符计数
在一键优化与撤销操作行右侧实时显示 Unicode 字符数和 200 字符上限。 补充计数更新、emoji 截断和右对齐布局测试,并同步编辑器方案文档。
This commit is contained in:
@@ -355,6 +355,15 @@ describe('ImageCanvasSpecGenerationPanelView', () => {
|
||||
'玩法设定',
|
||||
) as HTMLTextAreaElement;
|
||||
const artStyle = screen.getByLabelText('美术风格') as HTMLTextAreaElement;
|
||||
expect(screen.getByLabelText('玩法设定字符计数').textContent).toBe(
|
||||
'5/200',
|
||||
);
|
||||
expect(screen.getByLabelText('美术风格字符计数').textContent).toBe(
|
||||
'4/200',
|
||||
);
|
||||
expect(screen.getByLabelText('玩法设定字符计数').className).toContain(
|
||||
'ml-auto',
|
||||
);
|
||||
expect(playSetting.hasAttribute('maxlength')).toBe(false);
|
||||
expect(artStyle.hasAttribute('maxlength')).toBe(false);
|
||||
|
||||
@@ -362,6 +371,9 @@ describe('ImageCanvasSpecGenerationPanelView', () => {
|
||||
expect(Array.from(playSetting.value)).toHaveLength(200);
|
||||
fireEvent.change(playSetting, { target: { value: '🎮'.repeat(201) } });
|
||||
expect(Array.from(playSetting.value)).toHaveLength(200);
|
||||
expect(screen.getByLabelText('玩法设定字符计数').textContent).toBe(
|
||||
'200/200',
|
||||
);
|
||||
fireEvent.click(screen.getByRole('button', { name: '提交生成规范' }));
|
||||
expect(onSubmit).toHaveBeenCalledTimes(1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user