删除按已退役 Supervisor 聊天入口编写的 appSurface 用例

- 删除 project-commands / agent-runtime 两个 100% 依赖已退役聊天入口的用例文件及其注册
- 删除 project-assets 里 21 条「from chat」用例(整个套件同为该入口),并移除注册
- 删除 project-conversation 里 7 条、project-development 里 2 条依赖 home 聊天框与斜杠命令的用例
- appSurface 失败数由 114 降到 10,剩余 10 条为 DirectProject/预览/首页链路自身的既有失败
This commit is contained in:
2026-09-21 11:19:12 +08:00
parent 0224ef7b9d
commit 912f9afcd2
6 changed files with 3 additions and 8478 deletions
@@ -1,7 +1,6 @@
/** @vitest-environment jsdom */
import { vi } from 'vitest';
import { registerAgentRuntimeCommandTests } from './appSurface/agent-runtime.suite';
import { registerAuthTests } from './appSurface/auth.suite';
import { registerChatComposerControlTests } from './appSurface/chat-composer.suite';
import { registerDesignAgentSurfaceTests } from './appSurface/design-agent.suite';
@@ -12,11 +11,6 @@ import {
registerRecentProjectsTests,
} from './appSurface/home.suite';
import { registerPlanGddApprovalTests } from './appSurface/plan-gdd.suite';
import {
registerCanvasAssetTests,
registerProjectAssetTests,
} from './appSurface/project-assets.suite';
import { registerProjectCommandTests } from './appSurface/project-commands.suite';
import { registerProjectConversationTests } from './appSurface/project-conversation.suite';
import {
registerProjectAgentStatusTests,
@@ -35,8 +29,8 @@ import { registerToolCallGroupTests } from './appSurface/tool-call-group.suite';
*
* 这里只替代"用户选了哪个目标路径"这一件事:`save` 按调用方给的建议文件名返回一个
* 固定的导出路径,让「下载」用例能断言工具条真的走到了 `save_local_project_asset_file`。
* 声明必须留在入口文件:`project-assets.suite` 等模块比 `project-development.suite`
* 更早 import 工作台视图,放在别处注册会晚于真实模块实例化。
* 声明必须留在入口文件:`project-conversation.suite` 等模块比
* `project-development.suite` 更早 import 工作台视图,放在别处注册会晚于真实模块实例化。
*/
vi.mock('@tauri-apps/plugin-dialog', () => ({
open: async () => null,
@@ -56,10 +50,6 @@ describe('AI 游戏创作 App 界面边界', () => {
registerProjectPreviewAndRunHistoryTests();
registerProjectConversationTests();
registerProjectAgentStatusTests();
registerProjectCommandTests();
registerProjectAssetTests();
registerAgentRuntimeCommandTests();
registerCanvasAssetTests();
registerPlanGddApprovalTests();
registerDesignAgentSurfaceTests();
registerToolCallGroupTests();
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -22,7 +22,6 @@ import {
cleanup,
createGameCreationAppManifest,
createGameCreationAppSeedTasks,
emptyProjectPolicy,
expect,
findResourceSelectButton,
fireEvent,
@@ -31,7 +30,6 @@ import {
getResourceSelectButton,
installResizeObserverStub,
it,
mockRoleAgentReply,
openResourceFilterPanel,
ProjectDevelopmentView,
queryResourceSelectButton,
@@ -41,7 +39,6 @@ import {
renderAppAt,
resolve,
screen,
submitChat,
vi,
waitFor,
within,
@@ -6554,108 +6551,7 @@ export function registerProjectWorkbenchFoundationTests() {
});
}
export function registerProjectWorkbenchNavigationTests() {
it('keeps project switching inside the single-window client flow', async () => {
const invoke = vi.fn(async () => undefined);
window.__TAURI__ = { core: { invoke } };
renderAppAt('/?main');
fireEvent.click(screen.getByRole('button', { name: '切换项目' }));
expect(screen.getByText('请回到首页的项目组切换项目。')).not.toBeNull();
expect(invoke).not.toHaveBeenCalledWith(
'open_game_creator_launcher_window',
);
await submitChat('/switch-project');
expect(
screen.getAllByText('请回到首页的项目组切换项目。').length,
).toBeGreaterThanOrEqual(2);
expect(invoke).not.toHaveBeenCalledWith(
'open_game_creator_launcher_window',
);
});
it('opens the current project directory from the main project window', async () => {
const manifest = createGameCreationAppManifest(
'local-project-draft',
'未命名游戏原型',
);
const invoke = vi.fn(
async (command: string, args?: Record<string, unknown>) => {
if (command === 'append_local_permission_log') {
return {};
}
if (command === 'init_local_game_project') {
const projectPath = String(args?.projectPath ?? '');
return {
projectPath,
manifestPath: `${projectPath}/.agent/manifest.json`,
manifest,
};
}
if (command === 'read_project_permission_policy') {
return emptyProjectPolicy();
}
if (command === 'chat_with_game_creator_agent') {
return {
replyText: `主聊天回复:${String(args?.prompt ?? '')}`,
};
}
if (command === 'read_local_conversation') {
return {
path: '/tmp/authorized-game/.agent/conversations/project.jsonl',
agentId: null,
messages: [],
};
}
if (command === 'chat_with_game_creator_role_agent') {
return {
replyText: mockRoleAgentReply(),
};
}
if (command === 'append_local_conversation_message') {
return {
path: '/tmp/authorized-game/.agent/conversations/project.jsonl',
agentId: null,
messages: [],
};
}
if (command === 'open_local_project_directory') {
return undefined;
}
throw new Error(`unexpected invoke ${command}`);
},
);
window.__TAURI__ = { core: { invoke } };
renderAppAt('/?main&projectPath=%2Ftmp%2Fauthorized-game');
await screen.findByText('已打开:authorized-game');
const revealButtons = screen.getAllByRole('button', { name: '显示目录' });
fireEvent.click(revealButtons[revealButtons.length - 1]);
await waitFor(() => {
expect(invoke).toHaveBeenCalledWith('open_local_project_directory', {
projectPath: '/tmp/authorized-game',
});
});
expect(await screen.findByText('已打开项目目录。')).not.toBeNull();
await submitChat('/open-project');
await waitFor(() => {
expect(
invoke.mock.calls.filter(
([command]) => command === 'open_local_project_directory',
),
).toHaveLength(2);
});
expect(
screen.getAllByText('已打开项目目录。').length,
).toBeGreaterThanOrEqual(2);
});
}
export function registerProjectWorkbenchNavigationTests() {}
export function registerProjectAgentStatusTests() {
it('keeps ready task scheduling out of the normal user window', async () => {