/** * 宽屏回归:窄屏修复不能把桌面布局改坏。 * * 特别是两个只该在窄屏生效的东西: * - `.tap` 的伪元素命中区(桌面密排工具栏里会互相重叠) * - `BackButton`(宽屏列表与详情并排,返回没有意义) * * 用法:ADMIN_PW=<密码> node web/test/manual/wide-regression.mjs */ import { openApp, WIDE } from './narrow-probe-helper.mjs'; const { browser, page, issues } = await openApp(WIDE); const failed = []; const chk = (n, ok, note = '') => { console.log(` ${ok ? '通过' : '失败'} ${n}${note ? ' — ' + note : ''}`); if (!ok) failed.push(n); }; console.log('宽屏回归(1280px):'); const cols = await page.evaluate(() => { const root = document.querySelector('#root > div'); return { n: root?.children.length, first: root?.children[0]?.className?.toString().slice(0, 30) }; }); chk('仍是三栏并排', cols.n === 3, `栏数=${cols.n} 首栏=${cols.first}`); // 常驻侧栏是宽屏唯一的退出入口(账号页也有,两处都要在) const side = await page.evaluate(() => { const s = document.querySelector('#root > div > div'); const btns = s ? [...s.querySelectorAll('button')].map(b => (b.getAttribute('title') || b.textContent || '').trim().slice(0, 12) ) : []; return { w: s ? Math.round(s.getBoundingClientRect().width) : 0, btns }; }); chk('常驻侧栏仍有退出登录', side.btns.some(b => b.includes('退出')), `宽=${side.w}`); // 宽屏不该出现返回按钮 // 邮件行是