修复持久目标模式切换测试的异步竞态 #428
@@ -2519,6 +2519,11 @@ export function registerDeveloperAgentWindowTests() {
|
||||
|
||||
const emptyGoalPanel = await screen.findByLabelText('Agent Goal 状态');
|
||||
expect(within(emptyGoalPanel).getByText('尚未开始')).not.toBeNull();
|
||||
// 读取历史的异步链路未结束时按钮处于 disabled,等它可用再切换模式,避免点击落空。
|
||||
const goalModeButton = screen.getByRole('button', { name: '目标' });
|
||||
await waitFor(() => {
|
||||
expect(goalModeButton.hasAttribute('disabled')).toBe(false);
|
||||
});
|
||||
selectDeveloperAgentChatMode('goal');
|
||||
expect(
|
||||
screen.getByRole('button', { name: '目标' }).getAttribute('aria-pressed'),
|
||||
|
||||
Reference in New Issue
Block a user