diff --git a/client/electron/test/harmony-logic.test.mjs b/client/electron/test/harmony-logic.test.mjs index ea7af22..2b3fae2 100644 --- a/client/electron/test/harmony-logic.test.mjs +++ b/client/electron/test/harmony-logic.test.mjs @@ -502,7 +502,9 @@ test('通信页把三栏真的接上了:内部页签 + 徽标 + 悬浮加号 + // 底部第一项的标签是「通信」而不是「收件箱」(信息架构变了,标签必须跟着变) const tabLabels = [...sendCode.matchAll(/TabBarBuilder\('([^']+)'/g)].map(m => m[1]); assert.deepEqual(tabLabels, ['通信', '联系人'], `底部应只剩两项且第一项是通信,实际:${tabLabels.join('、')}`); - assert.match(sendCode, /CommPage\(\)/, '第一项要渲染通信页'); + // 通信页现在还要收一个 `bgActive`(背景开着时让出页面底,否则壁纸全被盖住)—— + // 所以这里钉的是"带参数地渲染通信页",不是光有个名字 + assert.match(sendCode, /CommPage\(\{ bgActive: this\.bgActive \}\)/, '第一项要渲染通信页(并把背景开关传下去)'); // 内部页签:三栏由 COMM_TABS 驱动,点击切到 normalizeCommTab 的**同一个函数** assert.match(sendCode, /ForEach\(COMM_TABS, \(key: string\)/, '页签栏要按页签清单渲染'); @@ -510,8 +512,10 @@ test('通信页把三栏真的接上了:内部页签 + 徽标 + 悬浮加号 + assert.match(sendCode, /badgeText\(badgeCount\(key, this\.unreadCount, this\.pendingCount\)\)/, '徽标数字走同一份规则'); assert.match(sendCode, /this\.commTab = normalizeCommTab\(key\)/, '点击要过状态机的归一化,不能直接赋值'); // 三个 pane 都要真的存在(少一个就是空页签) - for (const pane of ['InboxTab()', 'SentTab()', 'PermissionTab()']) { - assert.ok(sendCode.includes(pane), `通信页要渲染 ${pane}`); + // 三个 pane 都要真的存在(少一个就是空页签),且都要收到背景开关 + for (const pane of ['InboxTab', 'SentTab', 'PermissionTab']) { + assert.ok(sendCode.includes(`${pane}({ bgActive: this.bgActive })`), + `通信页要渲染 ${pane}(并把背景开关传下去)`); } // 悬浮加号在通信页这一层(三个栏都要能新建),形状是圆形