修复角色规范参考图前端回归测试
兼容画布参考图只读槽位的 aria-label 断言 等待画布选择参考图状态完成后再校验面板
This commit is contained in:
@@ -194,7 +194,12 @@ describe('ImageCanvasEditorView generation integration', () => {
|
||||
candidate.getAttribute('title') === label ||
|
||||
candidate.textContent?.includes(label),
|
||||
);
|
||||
expect(button).toBeTruthy();
|
||||
const chip =
|
||||
button ??
|
||||
Array.from(panel.querySelectorAll('[aria-label]')).find(
|
||||
(candidate) => candidate.getAttribute('aria-label') === label,
|
||||
);
|
||||
expect(chip).toBeTruthy();
|
||||
};
|
||||
|
||||
const createGeneratedResource = ({
|
||||
@@ -2361,10 +2366,12 @@ describe('ImageCanvasEditorView generation integration', () => {
|
||||
clientY: 120,
|
||||
},
|
||||
);
|
||||
expectReferenceChip(
|
||||
screen.getByRole('dialog', { name: '生成规范' }),
|
||||
'拼图素材',
|
||||
);
|
||||
await waitFor(() => {
|
||||
expectReferenceChip(
|
||||
screen.getByRole('dialog', { name: '生成规范' }),
|
||||
'拼图素材',
|
||||
);
|
||||
});
|
||||
|
||||
await userEvent.click(
|
||||
within(screen.getByRole('dialog', { name: '生成规范' })).getByRole(
|
||||
|
||||
Reference in New Issue
Block a user