现在有的接口对接测试完成

This commit is contained in:
2026-07-25 19:19:36 +08:00
parent 8870136d1b
commit 817d85e117
59 changed files with 26623 additions and 1576 deletions
+26
View File
@@ -0,0 +1,26 @@
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const test = require('node:test');
const NotificationPages = require('../public/js/notification-pages.js');
test('notification page preserves only the unexpanded PC list records and unread count', () => {
const rows = [{ notificationId: '2060000000000000001', title: '系统通知' }];
assert.deepEqual(NotificationPages.normalizeNotifications(rows), rows);
assert.deepEqual(NotificationPages.normalizeNotifications({ rows }), []);
assert.equal(NotificationPages.getUnreadCount(3), 3);
assert.equal(NotificationPages.getUnreadCount(-1), 0);
assert.equal(NotificationPages.formatNotification(rows[0]), '{\n "notificationId": "2060000000000000001",\n "title": "系统通知"\n}');
});
test('message page loads the PC notification module instead of pending-page controls', () => {
const source = fs.readFileSync(path.join(__dirname, '..', 'profile-messages.html'), 'utf8');
assert.doesNotMatch(source, /data-feature-status="pending"/);
assert.match(source, /src="public\/js\/notification-pages\.js"/);
assert.doesNotMatch(source, /src="public\/js\/pending-pages\.js"/);
assert.match(source, /data-notification-unread-count/);
assert.match(source, /data-notification-read-all/);
});