mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-06-29 01:45:54 +08:00
ff343185c9
- 安装 @playwright/test 1.60.0 - 创建 e2e/playwright.config.ts(webServer 自动启动 vite dev) - 创建 e2e/mocks/ipc.ts(Tauri IPC mock) - 新增 npm run test:e2e 脚本 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
25 lines
1005 B
TypeScript
25 lines
1005 B
TypeScript
export function createIpcMock() {
|
|
return `
|
|
window.__TAURI_INTERNALS__ = {
|
|
invoke: async (cmd, args) => {
|
|
switch (cmd) {
|
|
case 'check_admin': return true;
|
|
case 'load_system_paths': return ['C:\\\\Windows', 'C:\\\\Program Files'];
|
|
case 'load_user_paths': return ['C:\\\\Users\\\\me\\\\AppData'];
|
|
case 'load_disabled_state': return { system: [], user: [] };
|
|
case 'save_system_paths': return undefined;
|
|
case 'save_user_paths': return undefined;
|
|
case 'save_disabled_state': return undefined;
|
|
case 'backup_registry': return 'C:\\\\backup\\\\path.txt';
|
|
case 'broadcast_env_change': return undefined;
|
|
case 'validate_path': return true;
|
|
case 'expand_env_vars': return 'C:\\\\Expanded';
|
|
case 'read_text_file': return '';
|
|
case 'get_appdata_dir': return 'C:\\\\appdata';
|
|
default: throw new Error('Unexpected invoke: ' + cmd);
|
|
}
|
|
}
|
|
};
|
|
`;
|
|
}
|