From 9baf96f4e80f8d81fc07e101e3765274acf482f5 Mon Sep 17 00:00:00 2001 From: yibaiba <946100224@qq.com> Date: Wed, 9 Sep 2026 09:59:03 +0800 Subject: [PATCH] test(web): align source assertions with i18n --- web/tests/brandSource.test.ts | 11 +++++++---- web/tests/phonePresentation.test.ts | 4 +++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/web/tests/brandSource.test.ts b/web/tests/brandSource.test.ts index 243bf2f4..9b5b8d13 100644 --- a/web/tests/brandSource.test.ts +++ b/web/tests/brandSource.test.ts @@ -7,7 +7,7 @@ async function source(path: string) { } test('production Vue surfaces present the HiDeck brand consistently', async () => { - const [app, shell, login, loading, header, commands, automation, settings, atConsole] = await Promise.all([ + const [app, shell, login, loading, header, commands, automation, settings, atConsole, zhCN] = await Promise.all([ source('../src/App.vue'), source('../src/layouts/AuthenticatedShell.vue'), source('../src/views/Login.vue'), @@ -16,7 +16,8 @@ test('production Vue surfaces present the HiDeck brand consistently', async () = source('../src/components/commands/CommandChat.vue'), source('../src/views/AutomaticTasks.vue'), source('../src/views/Settings.vue'), - source('../src/components/DeviceAtTab.vue') + source('../src/components/DeviceAtTab.vue'), + source('../src/i18n/zh-CN.ts') ]) const visibleSources = [app, shell, login, loading, header, commands, automation, settings, atConsole] @@ -27,8 +28,10 @@ test('production Vue surfaces present the HiDeck brand consistently', async () = assert.match(shell, /sidebar-brand-title">HiDeckHIDECKH { assert.match(router, /path: '\/phone'/) assert.match(shell, //) - assert.match(shell, /index: '\/phone', label: '电话'/) + assert.match(shell, /index: '\/phone', label: t\('nav\.phone'\)/) + assert.match(zhCN, /phone:\s*'电话'/) assert.match(shell, /v-for="item in mobileMenuItems"/) })