家谱现有接口调试50%

This commit is contained in:
rain
2026-07-09 17:29:25 +08:00
commit 6050508144
262 changed files with 63354 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
const assert = require('assert');
const MemoPages = require('../public/js/memo-pages.js');
function run() {
assert.deepStrictEqual(MemoPages.normalizeList({ rows: [{ memoId: 1 }] }), [{ memoId: 1 }]);
assert.deepStrictEqual(MemoPages.normalizeList({ records: [{ memoId: 2 }] }), [{ memoId: 2 }]);
assert.deepStrictEqual(MemoPages.buildMemoBody({
memoTitle: ' 修谱事项 ',
memoContent: ' 联系族亲 ',
remindTime: '',
completed: '',
mediaOssIds: ' 2060001 ',
sortOrder: '',
status: ''
}), {
memoTitle: '修谱事项',
memoContent: '联系族亲',
remindTime: undefined,
completed: '0',
mediaOssIds: '2060001',
sortOrder: 1,
status: '0'
});
assert.strictEqual(
MemoPages.buildMemoRow({
memoId: 801,
memoTitle: '修谱事项',
completed: '0',
remindTime: '2026-08-01'
}, '900001001'),
'<a class="module-row memo-row" href="profile-memo-edit.html?memoId=801&genealogyId=900001001"><div><h3>修谱事项</h3><p>未完成 · 2026-08-01</p></div><span class="pill">编辑</span></a>'
);
console.log('memo-pages tests passed');
}
run();