21 lines
1.0 KiB
TypeScript
21 lines
1.0 KiB
TypeScript
import test from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import { readSource } from './helpers.ts'
|
|
import { historyEmptyText } from '../src/pages/records/history-feedback.ts'
|
|
|
|
/** 对齐 admin.html:5769-5770(类型/创建时间列名) 与 admin.js:2866(暂无记录)。 */
|
|
|
|
test('align_history_column_labels', () => {
|
|
const page = readSource('src/pages/records/RecordsHistoryPage.vue')
|
|
assert.match(page, /<th[^>]*>类型<\/th>/, '列名对齐参考「类型」(自绘 th)')
|
|
assert.match(page, /<th[^>]*>创建时间<\/th>/, '列名对齐参考「创建时间」(自绘 th)')
|
|
assert.doesNotMatch(page, /记录类型/, '去掉“记录类型”列名')
|
|
assert.doesNotMatch(page, /label="生成时间"/, '去掉“生成时间”列名')
|
|
})
|
|
|
|
test('align_history_empty_text', () => {
|
|
assert.equal(historyEmptyText({ hasFilter: true, total: 0 }), '暂无记录')
|
|
assert.equal(historyEmptyText({ hasFilter: false, total: 0 }), '暂无记录')
|
|
assert.equal(historyEmptyText({ hasFilter: false, total: 2 }), '')
|
|
})
|