fix(user-center): 防止大额资产金额断行

This commit is contained in:
2026-09-16 17:23:56 +08:00
parent e7ffb44b45
commit 56d1b2a417
9 changed files with 59 additions and 5 deletions
@@ -38,6 +38,26 @@ test('dual asset layout returns to a single-column flex flow on mobile', () => {
assert.match(mobile[1], /\.uc-assets-row--dual\s*>\s*\.uc-assets-col\s*\{[\s\S]*?display:\s*flex;/)
assert.match(mobile[1], /grid-column:\s*auto;/)
assert.match(mobile[1], /grid-row:\s*auto;/)
assert.match(mobile[1], /\.uc-asset-card__body\s*\{[\s\S]*?flex-direction:\s*column;/)
})
test('asset card amounts stay on one line and actions wrap below as a whole', () => {
const css = read('assets/css/routes/user-center/credits.css')
assert.match(css, /\.uc-assets-row\s*\{[\s\S]*?grid-template-columns:\s*minmax\(0,\s*1fr\);/)
assert.match(css, /\.uc-asset-card\s*\{[\s\S]*?min-width:\s*0;/)
assert.match(css, /\.uc-asset-card__body\s*\{[\s\S]*?flex-wrap:\s*wrap;/)
assert.match(css, /\.uc-asset-card__amount\s*\{[\s\S]*?white-space:\s*nowrap;[\s\S]*?font-variant-numeric:\s*tabular-nums;[\s\S]*?text-overflow:\s*ellipsis;/)
})
test('asset card amounts expose the full value via title tooltips', () => {
const wallet = read('inc/helpers/user-center-renderers/credits-wallet.php')
const balance = read('inc/helpers/user-center-renderers/credits-balance.php')
const amount = read('src/Ledger/AssetAmount.php')
assert.match(wallet, /data-aksrt-wallet-value[^>]*title="/)
assert.match(balance, /data-aksrt-points-value[^>]*data-credits-value[^>]*title="/)
assert.match(amount, /number_format_i18n\(intdiv\(\$this->minor, 100\)\)/)
})
test('removed asset card selectors do not return in loaded user-center styles', () => {