const assert = require('node:assert/strict'); const fs = require('node:fs'); const path = require('node:path'); const test = require('node:test'); const PageAvailability = require('../public/js/pending-pages.js'); const root = path.resolve(__dirname, '..'); const familyPendingPages = [ 'profile-families.html', 'profile-create-family.html', 'profile-join-family.html', 'profile-join-review.html', 'profile-family-admin.html', 'profile-invite.html', 'profile-tree.html', 'profile-generation.html' ]; const contentPendingPages = [ 'profile-content.html', 'profile-article.html', 'profile-article-edit.html', 'profile-album.html', 'profile-video.html', 'profile-gift.html', 'profile-gift-edit.html', 'profile-growth.html', 'profile-growth-edit.html', 'profile-memo.html', 'profile-memo-edit.html', 'profile-merit.html', 'profile-merit-edit.html', 'profile-messages.html', 'profile-feedback.html', 'profile-admin-permissions.html', 'profile-data-reminders.html' ]; const residualPendingPages = [ 'profile-family-home.html', 'profile-share.html', 'profile-services.html' ]; const pendingPages = familyPendingPages.concat(contentPendingPages, residualPendingPages); function read(relativePath) { return fs.readFileSync(path.join(root, relativePath), 'utf8'); } function createLink(attributes) { return { getAttribute(name) { return Object.prototype.hasOwnProperty.call(attributes, name) ? attributes[name] : null; } }; } test('待开发页面生成明确且转义后的状态提示', () => { assert.match(PageAvailability.buildBanner('家谱基础服务正在开发中'), /家谱基础服务正在开发中/); assert.match(PageAvailability.buildBanner('