From bd26d40d49f14d2c5bf2da54f255b0d6bfacc2ca Mon Sep 17 00:00:00 2001 From: bone3deep1962-collab Date: Thu, 12 Nov 2026 17:35:10 +0800 Subject: [PATCH] Update installation and localization fixtures for canonical names --- studio/src/i18n/ConnectionI18n.test.ts | 2 +- tests/bootstrap.test.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/studio/src/i18n/ConnectionI18n.test.ts b/studio/src/i18n/ConnectionI18n.test.ts index cea9b10e1..248b26142 100644 --- a/studio/src/i18n/ConnectionI18n.test.ts +++ b/studio/src/i18n/ConnectionI18n.test.ts @@ -168,7 +168,7 @@ it('reloads localized catalog data while preserving the chosen client, search an vi.spyOn(HTMLMediaElement.prototype, 'pause').mockImplementation(() => {}); vi.spyOn(HTMLMediaElement.prototype, 'load').mockImplementation(() => {}); vi.spyOn(navigator.clipboard, 'writeText').mockResolvedValue(); - const info = { name: 'OpenMotion', version: '0.6.2', previewUrl: 'http://localhost:4173', dataDirectory: '/test/workspace', transport: { type: 'stdio', command: 'node', args: ['mcp.ts'], env: { MOTION_DATA_DIR: '/test/workspace' } }, tools: [{ name: 'motion_import_assets', description: 'Import assets' }, { name: 'motion_list_templates', description: 'List templates' }, { name: 'motion_get_template', description: 'Template details' }] }; + const info = { name: 'OpenMotion', version: '0.6.2', previewUrl: 'http://localhost:4173', dataDirectory: '/test/workspace', transport: { type: 'stdio', command: 'node', args: ['mcp.ts'], env: { MOTION_DATA_DIR: '/test/workspace' } }, tools: [{ name: 'openmotion_import_assets', description: 'Import assets' }, { name: 'openmotion_list_templates', description: 'List templates' }, { name: 'openmotion_get_template', description: 'Template details' }] }; const template = { id: 'reference', title: 'Preview', author: 'Creator', description: 'Original template description', tags: [], role: 'a-roll', collection: 'moment', kind: 'reference' }; const warning = '模板更新失败,使用已缓存目录:HTTP 503'; vi.stubGlobal('fetch', vi.fn(async (url: string) => new Response(JSON.stringify(url.endsWith('/integration') ? info : { items: [template], total: 1, entryTotal: 1, catalogTotal: 1, offset: 0, next: null, warning })))); diff --git a/tests/bootstrap.test.ts b/tests/bootstrap.test.ts index dad71cb5f..aba871d9c 100644 --- a/tests/bootstrap.test.ts +++ b/tests/bootstrap.test.ts @@ -47,7 +47,7 @@ test('remote entry point builds a fresh checkout before registering and checking assert.match(commands, /git clone --depth 1 --branch test-ref -- https:\/\/github\.com\/nexu-io\/openmotion\.git/); assert.ok(commands.indexOf('npm ci --include=dev') < commands.indexOf('npm run build:studio')); assert.ok(commands.indexOf('npm run build:studio') < commands.indexOf('codex plugin marketplace add')); - assert.match(commands, /codex plugin add motion@motion-local\ncodex plugin list --marketplace motion-local\nMCP check/); + assert.match(commands, /codex plugin add openmotion@openmotion-local\ncodex plugin list --marketplace openmotion-local\nMCP check/); assert.match(result.stdout, /OpenMotion registration and independent MCP preflight succeeded/); const onboarding = JSON.parse(result.stdout.slice(result.stdout.indexOf('\n{') + 1)); assert.equal(onboarding.hostSessionVerified, false); @@ -98,7 +98,7 @@ for (const [failure, expected] of [ const result = spawnSync('bash', [path.join(root, 'install.sh')], { env: { ...env, [failure]: '1' }, encoding: 'utf8' }); assert.notEqual(result.status, 0); if (expected) assert.match(result.stderr, expected); - assert.doesNotMatch(await readFile(log, 'utf8'), /marketplace add|plugin add motion@/); + assert.doesNotMatch(await readFile(log, 'utf8'), /marketplace add|plugin add openmotion@/); assert.doesNotMatch(result.stdout, /preflight succeeded|Installation-success reply/); }); }); @@ -108,7 +108,7 @@ test('MCP verification failure is reported even after plugin registration', asyn await fixture(async ({ log, env }) => { const result = spawnSync('bash', [path.join(root, 'install.sh')], { env: { ...env, MOTION_TEST_MCP_FAIL: '1' }, encoding: 'utf8' }); assert.notEqual(result.status, 0); - assert.match(await readFile(log, 'utf8'), /plugin add motion@motion-local/); + assert.match(await readFile(log, 'utf8'), /plugin add openmotion@openmotion-local/); assert.doesNotMatch(result.stdout, /preflight succeeded|Installation-success reply/); }); }); @@ -119,7 +119,7 @@ test('a missing onboarding contract stops before plugin registration', async () const result = spawnSync('bash', [path.join(root, 'install.sh')], { env, encoding: 'utf8' }); assert.notEqual(result.status, 0); assert.match(result.stderr, /install\.md/); - assert.doesNotMatch(await readFile(log, 'utf8'), /marketplace add|plugin add motion@/); + assert.doesNotMatch(await readFile(log, 'utf8'), /marketplace add|plugin add openmotion@/); assert.doesNotMatch(result.stdout, /preflight succeeded|Installation-success reply/); }); });