* 新增自适应数值与窗口分析工具,提升交互体验 * 优化回收站模块逻辑,增加展示与选择功能 * 引入 Macaron 主题配置文件并更新 Tailwind 配置 * 精简基础组件代码,移除冗余样式与设置项 * 完善测试用例,覆盖 UI 系统与回收站工作流 * 更新多语言配置,支持功能变更后的文案需求
11 lines
462 B
JavaScript
11 lines
462 B
JavaScript
import {test} from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import {fitValueFontSize} from '../src/utils/adaptiveValue.ts'
|
|
test('fits the value to available width without exceeding readable bounds',()=>{
|
|
assert.equal(fitValueFontSize(120,100,24,14),24)
|
|
assert.equal(fitValueFontSize(80,120,24,14),16)
|
|
assert.equal(fitValueFontSize(20,120,24,14),14)
|
|
assert.equal(fitValueFontSize(0,120,24,14),24)
|
|
assert.equal(fitValueFontSize(100,0,24,14),24)
|
|
})
|