Files
X-Financial/web/tests/topbar-compact-laptop.test.mjs

24 lines
1.1 KiB
JavaScript
Raw Permalink Normal View History

import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import test from 'node:test'
import { fileURLToPath } from 'node:url'
const topbarStyles = readFileSync(
fileURLToPath(new URL('../src/assets/styles/components/top-bar.css', import.meta.url)),
'utf8'
)
test('topbar uses a compact laptop layout without overriding mobile layout', () => {
assert.match(
topbarStyles,
/@media \(min-width: 961px\) and \(max-width: 1440px\),\s*\n\s*\(min-width: 961px\) and \(max-height: 820px\)/
)
assert.match(topbarStyles, /\.topbar\s*\{[\s\S]*padding:\s*12px 20px 14px;/)
assert.match(topbarStyles, /\.topbar h1\s*\{[\s\S]*font-size:\s*22px;/)
assert.match(topbarStyles, /\.topbar p\s*\{[\s\S]*-webkit-line-clamp:\s*1;/)
assert.match(topbarStyles, /\.range-shell\s*\{[\s\S]*height:\s*36px;/)
assert.match(topbarStyles, /\.dashboard-switch-select :deep\(\.el-select__wrapper\)\s*\{[\s\S]*min-height:\s*38px;/)
assert.match(topbarStyles, /\.topbar-icon-btn\s*\{[\s\S]*width:\s*30px;[\s\S]*height:\s*30px;/)
assert.match(topbarStyles, /@media \(max-width: 960px\)[\s\S]*\.topbar\s*\{[\s\S]*flex-direction:\s*column;/)
})