Files
wechat_wc/tools/liquid-glass.test.mjs
T
broccoli 242c52af43 feat(ui): 迁移液态玻璃质感(TabBar/返回按钮)
- 自定义 TabBar 增加弯月面聚光带与银丝边缘,玻璃参数升级
- 全局返回按钮与 ScrollTopMask 返回按钮升级 135° 液态玻璃渐变
- 激活态升级为玻璃透镜,浅色/深色主题同步
- 新增 tools/liquid-glass.test.mjs 回归断言
- 同步构建产物 dist/,并合并此前未提交的 .claude 配置与 dist 变更
2026-08-18 21:30:39 +08:00

36 lines
1.5 KiB
JavaScript

import test from 'node:test'
import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import { fileURLToPath } from 'node:url'
import path from 'node:path'
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
const read = (rel) => readFileSync(path.join(root, rel), 'utf8')
test('custom tab bar renders the liquid-glass overlay layers', () => {
const source = read('src/custom-tab-bar/index.tsx')
assert.match(source, /tab-bar-caustic/)
assert.match(source, /tab-bar-rim/)
})
test('custom tab bar uses bright glass material and the silver rim', () => {
const css = read('src/custom-tab-bar/index.scss')
assert.match(css, /backdrop-filter: blur\(32px\) saturate\(1\.7\) brightness\(1\.05\)/)
assert.match(css, /-webkit-backdrop-filter: blur\(32px\) saturate\(1\.7\) brightness\(1\.05\)/)
assert.match(css, /mask-composite: exclude/)
assert.match(css, /linear-gradient\(\s*135deg/)
})
test('global back buttons use the liquid-glass gradient and inner shading', () => {
const css = read('src/app.scss')
assert.match(css, /background: linear-gradient\(\s*135deg/)
assert.match(css, /backdrop-filter: blur\(24px\) saturate\(1\.7\) brightness\(1\.05\)/)
assert.match(css, /\.theme-dark \.back-btn/)
})
test('scroll top back button matches the global liquid-glass back style', () => {
const css = read('src/components/ScrollTopMask/index.scss')
assert.match(css, /background: linear-gradient\(\s*135deg/)
assert.match(css, /backdrop-filter: blur\(24px\) saturate\(1\.7\) brightness\(1\.05\)/)
})