diff --git a/apps/web/index.html b/apps/web/index.html index fbc75cd..96f111a 100644 --- a/apps/web/index.html +++ b/apps/web/index.html @@ -4,12 +4,9 @@ - - - SimAdmin Nexus · 多节点控制台 + + + SimAdmin Control · 多节点控制台
diff --git a/apps/web/public/favicon.svg b/apps/web/public/favicon.svg new file mode 100644 index 0000000..228cdc6 --- /dev/null +++ b/apps/web/public/favicon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/apps/web/src/app-branding.test.ts b/apps/web/src/app-branding.test.ts new file mode 100644 index 0000000..106ae57 --- /dev/null +++ b/apps/web/src/app-branding.test.ts @@ -0,0 +1,17 @@ +import { readFile } from 'node:fs/promises'; + +import { describe, expect, it } from 'vitest'; + +describe('browser branding', () => { + it('uses the SimAdmin Control title and warm static favicon', async () => { + const indexHtml = await readFile(new URL('../index.html', import.meta.url), 'utf8'); + + expect(indexHtml).toContain('href="/favicon.svg"'); + expect(indexHtml).toContain('content="#f3f0e7"'); + expect(indexHtml).toContain('SimAdmin Control · 多节点控制台'); + + const faviconSvg = await readFile(new URL('../public/favicon.svg', import.meta.url), 'utf8'); + expect(faviconSvg).toContain('#f6c95f'); + expect(faviconSvg).toContain('#725d42'); + }); +}); diff --git a/apps/web/src/app-shell.integration.test.tsx b/apps/web/src/app-shell.integration.test.tsx index d6458ef..7e18f76 100644 --- a/apps/web/src/app-shell.integration.test.tsx +++ b/apps/web/src/app-shell.integration.test.tsx @@ -110,6 +110,9 @@ describe('React AppShell and Fleet vertical slice', () => { ).toBeTruthy(); expect(screen.getByLabelText('控制台版本 0.1.0')).toBeTruthy(); expect(screen.getByText('v0.1.0')).toBeTruthy(); + expect(screen.queryByText('多节点蜂窝设备控制中心')).toBeNull(); + expect(screen.getByRole('link', { name: 'animal-island-ui' })).toBeTruthy(); + expect(screen.getByRole('link', { name: 'CC BY-NC 4.0' })).toBeTruthy(); expect( consoleError.mock.calls.some((call) => call.some((argument) => String(argument).includes('unique "key" prop')), @@ -157,9 +160,11 @@ describe('React AppShell and Fleet vertical slice', () => { expect(within(card).getByText('18.4%')).toBeTruthy(); expect(within(card).getByText('63.2%')).toBeTruthy(); expect(within(card).getByText('46.7 °C')).toBeTruthy(); - expect(within(card).getByText('13800138000')).toBeTruthy(); + expect(within(card).getByText('138 •••• 8000')).toBeTruthy(); expect(await within(card).findByText('收到')).toBeTruthy(); - expect(within(card).getByText('13900139000')).toBeTruthy(); + expect(within(card).getByText('139 •••• 9000')).toBeTruthy(); + expect(within(card).queryByText('13800138000')).toBeNull(); + expect(within(card).queryByText('13900139000')).toBeNull(); expect(within(card).queryByText(/这是一条用于聚合页展示/)).toBeNull(); expect(within(card).getByText(/2026/)).toBeTruthy(); expect(within(card).queryByText('能力未知')).toBeNull(); @@ -174,6 +179,10 @@ describe('React AppShell and Fleet vertical slice', () => { expect(within(card).queryByRole('button', { name: '重启服务 Bravo' })).toBeNull(); expect(within(card).queryByRole('button', { name: '系统重启 Bravo' })).toBeNull(); + await user.click(within(card).getByRole('button', { name: '显示 Bravo 手机号' })); + expect(within(card).getByText('13800138000')).toBeTruthy(); + expect(within(card).getByText('13900139000')).toBeTruthy(); + await user.click(within(card).getByRole('button', { name: '实例操作 Bravo' })); expect(within(card).getByRole('menuitem', { name: '重启服务 Bravo' })).toBeTruthy(); diff --git a/apps/web/src/app-shell.tsx b/apps/web/src/app-shell.tsx index b08ff00..739a171 100644 --- a/apps/web/src/app-shell.tsx +++ b/apps/web/src/app-shell.tsx @@ -659,7 +659,6 @@ export function AppShell({ SimAdmin Control - 多节点蜂窝设备控制中心