拆分预览快捷操作测试并修复初始化时序

将单条长流程拆为 79 个独立用例,每例重新初始化并使用默认超时
保留有效行为断言并删除无实际操作的空断言块
补齐编辑器插件 mock,移除重复的项目打开状态等待
同步测试拆分边界与定向验证文档
This commit is contained in:
2026-09-20 18:04:35 +08:00
parent 3e97ba154d
commit b0cfbe4f63
9 changed files with 5972 additions and 5750 deletions
@@ -1,20 +1,11 @@
import { it } from '../harness';
import { openPreviewShortcutProject } from './preview-shortcuts/actions';
import { arrangePreviewShortcutTest } from './preview-shortcuts/arrange';
import { assertPlanningAndStatusShortcutFlow } from './preview-shortcuts/assert-planning-and-status-shortcuts';
import { assertPlaytestAndReleaseShortcutFlow } from './preview-shortcuts/assert-playtest-and-release-shortcuts';
import { assertProjectAndDesignShortcutFlow } from './preview-shortcuts/assert-project-and-design-shortcuts';
import { assertProjectToolsAndPreviewFlow } from './preview-shortcuts/assert-project-tools-and-preview';
import { registerPlanningAndStatusShortcutTests } from './preview-shortcuts/assert-planning-and-status-shortcuts';
import { registerPlaytestAndReleaseShortcutTests } from './preview-shortcuts/assert-playtest-and-release-shortcuts';
import { registerProjectAndDesignShortcutTests } from './preview-shortcuts/assert-project-and-design-shortcuts';
import { registerProjectToolsAndPreviewTests } from './preview-shortcuts/assert-project-tools-and-preview';
export function registerProjectPreviewShortcutTests() {
it('runs preview shortcuts from the main project window', async () => {
const { invoke } = arrangePreviewShortcutTest();
openPreviewShortcutProject();
await assertProjectAndDesignShortcutFlow(invoke);
await assertPlanningAndStatusShortcutFlow(invoke);
await assertPlaytestAndReleaseShortcutFlow(invoke);
await assertProjectToolsAndPreviewFlow(invoke);
}, 60000);
registerProjectAndDesignShortcutTests();
registerPlanningAndStatusShortcutTests();
registerPlaytestAndReleaseShortcutTests();
registerProjectToolsAndPreviewTests();
}
@@ -1,5 +1,9 @@
import { renderAppAt } from '../../harness';
import { renderAppAt, screen } from '../../harness';
import { arrangePreviewShortcutTest } from './arrange';
export function openPreviewShortcutProject() {
export async function openPreviewShortcutProject() {
const { invoke } = arrangePreviewShortcutTest();
renderAppAt('/?main&projectPath=%2Ftmp%2Fauthorized-game');
await screen.findByText('已打开:authorized-game');
return invoke;
}
@@ -7,6 +7,9 @@ export function createPreviewShortcutInvoke({
}: PreviewShortcutFixture) {
const invoke = vi.fn(
async (command: string, args?: Record<string, unknown>) => {
if (command === 'set_agc_plugin_project_path') {
return null;
}
if (command === 'append_local_permission_log') {
return {};
}
@@ -296,7 +299,3 @@ export function createPreviewShortcutInvoke({
return invoke;
}
export type PreviewShortcutInvoke = ReturnType<
typeof createPreviewShortcutInvoke
>;