style(frontend): 对齐 Alright 主题并接入离线字体
- 主题色板、圆角、阴影与 0.3s 缓动对齐参考站点,布局与尺寸不变 - index.html 预加载本地字体,index.css 定义 LXGW WenKai / Outfit-Medium - 新增断网渲染端到端用例与 ADR-0006
This commit is contained in:
@@ -221,3 +221,41 @@ test('cancels a running task from the log drawer', async ({
|
||||
await drawer.getByRole('button', { name: '取消运行' }).click()
|
||||
await expect(drawer.locator('.status-cancelled').first()).toBeVisible()
|
||||
})
|
||||
|
||||
test('renders fully offline with bundled fonts', async ({ page }) => {
|
||||
const blocked: string[] = []
|
||||
await page.route('**/*', (route) => {
|
||||
const url = route.request().url()
|
||||
const isLocal =
|
||||
url.startsWith('http://127.0.0.1:5173') ||
|
||||
url.startsWith('http://localhost:5173') ||
|
||||
url.startsWith('data:') ||
|
||||
url.startsWith('blob:')
|
||||
if (isLocal) {
|
||||
return route.continue()
|
||||
}
|
||||
blocked.push(url)
|
||||
return route.abort()
|
||||
})
|
||||
|
||||
await page.goto('/')
|
||||
await expect(page.getByRole('heading', { name: 'TaskPilot' })).toBeVisible()
|
||||
|
||||
const fonts = await page.evaluate(async () => {
|
||||
await document.fonts.ready
|
||||
return {
|
||||
wenkai: document.fonts.check('14px "LXGW WenKai"'),
|
||||
display: document.fonts.check('500 26px "Outfit-Medium"'),
|
||||
loaded: Array.from(document.fonts).map((face) => face.family),
|
||||
}
|
||||
})
|
||||
|
||||
expect(blocked).toEqual([])
|
||||
expect(fonts.wenkai).toBe(true)
|
||||
expect(fonts.display).toBe(true)
|
||||
expect(fonts.loaded).toContain('LXGW WenKai')
|
||||
await page.screenshot({
|
||||
path: 'test-results/dashboard-offline.png',
|
||||
fullPage: true,
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user