| 1234567891011121314 |
- import test from 'node:test'
- import assert from 'node:assert/strict'
- import fs from 'node:fs'
- import path from 'node:path'
- const addFile = path.resolve('src/views/modules/activity/add.vue')
- test('活动编辑页使用字符串分类 ID,避免雪花 ID 精度丢失导致下拉无法回显', () => {
- const source = fs.readFileSync(addFile, 'utf8')
- assert.match(source, /:value="String\(item\.id\)"/)
- assert.match(source, /map\(id\s*=>\s*String\(id\)\.trim\(\)\)/)
- assert.doesNotMatch(source, /\.map\(Number\)/)
- })
|