Ensure device cards show complete content

This commit is contained in:
chick
2026-07-08 00:24:58 +08:00
parent 4f80e951d4
commit 0ac6faa6a3
2 changed files with 22 additions and 2 deletions
+21 -1
View File
@@ -33,5 +33,25 @@ test('home screen is a simadmin card wall and device detail owns interactions',
const homeBlock = html.match(/<section id="homeView"[\s\S]*?<\/section>\s*<section id="detailView"/)
assert.ok(homeBlock, 'homeView should exist before detailView')
assert.doesNotMatch(homeBlock[0], /API 地图|endpointList|接口路径|rawOutput/)
assert.doesNotMatch(html, /dashboardView/)
})
test('home device cards show complete content without ellipsis truncation', async () => {
const css = await text('public/styles.css')
assert.match(css, /\.sim-device-card/)
assert.match(css, /\.home-device-grid/)
const forbiddenSelectors = [
'.sim-card-kpis b',
'.sim-card-foot',
'.sim-card-model',
'.instance-url',
]
for (const selector of forbiddenSelectors) {
const block = css.match(new RegExp(selector.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '[^{]*\\{([^}]*)\\}', 's'))
assert.ok(block, `missing CSS block for ${selector}`)
assert.doesNotMatch(block[1], /text-overflow\s*:\s*ellipsis|white-space\s*:\s*nowrap|overflow\s*:\s*hidden/, `${selector} must not truncate content`)
}
})