Ensure device cards show complete content
This commit is contained in:
@@ -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`)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user