拆分预览快捷操作测试并修复初始化时序
将单条长流程拆为 79 个独立用例,每例重新初始化并使用默认超时 保留有效行为断言并删除无实际操作的空断言块 补齐编辑器插件 mock,移除重复的项目打开状态等待 同步测试拆分边界与定向验证文档
This commit is contained in:
+8
-17
@@ -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();
|
||||
}
|
||||
|
||||
+6
-2
@@ -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;
|
||||
}
|
||||
|
||||
+1732
-1655
File diff suppressed because it is too large
Load Diff
+1753
-1769
File diff suppressed because it is too large
Load Diff
+1589
-1527
File diff suppressed because it is too large
Load Diff
+877
-776
File diff suppressed because it is too large
Load Diff
+3
-4
@@ -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
|
||||
>;
|
||||
|
||||
Reference in New Issue
Block a user