|
|
@@ -67,7 +67,8 @@ try {
|
|
|
return value.result.value;
|
|
|
};
|
|
|
const fixture = { result: { ok: true, data: { project: [], artifact: [], insight: [], source: [], session: [], opportunity: [], asOf: '2026-11-03T00:00:00.000Z', nextCursor: null } } };
|
|
|
- fixture.result.data.artifact.push({ objectId: 'fixture-report', title: '原有报告回归', stageCode: 'S4', report: { title: '原有报告回归', chapters: [{ id: 'scope', title: '核对原文', sections: [{ kind: 'para', text: '公开报告阅读回归正文。' }] }], evidence: {} } });
|
|
|
+ fixture.result.data.artifact.push({ objectId: 'fixture-report', title: '原有报告回归', stageCode: 'S4', artifactType: 'competitor_report', report: { title: '原有报告回归', chapters: [{ id: 'scope', title: '核对原文', sections: [{ kind: 'para', text: '公开报告阅读回归正文。' }] }], evidence: {} } });
|
|
|
+ for (const type of ['category_report', 'voc_report', 'pain_list', 'concept']) fixture.result.data.artifact.push({ objectId: 'fixture-' + type, artifactType: type, title: '中文标题完整显示与多行排版验证', stageCode: 'S1', rawText: '本机回放排版测试资料。', createdAt: '2026-11-03T00:00:00.000Z' });
|
|
|
fixture.result.data.opportunity.push({ objectId: 'fixture-opportunity', title: '原有机会卡回归', status: 'candidate', linkedArtifacts: ['fixture-report'], scores: [], updatedAt: '2026-11-03T00:00:00.000Z' });
|
|
|
socket.addEventListener('message', ({ data }) => {
|
|
|
const m = JSON.parse(data);
|
|
|
@@ -264,6 +265,26 @@ try {
|
|
|
check('existing live route resumes loading', forbidden.some((r) => r.body.includes('ksfGetPublicBoard')));
|
|
|
check('existing desktop and mobile navigation expose base-safe demo entry', await evaluate(`(()=>{const root=document.querySelector('kf-app').shadowRoot.querySelector('kf-nav').shadowRoot;return root.querySelector('a[data-path="/showcase"]').href.includes('/preview-test/showcase')&&root.querySelector('.showcase-entry').href.includes('/preview-test/showcase');})()`));
|
|
|
const legacyNavigate = async (route) => { await evaluate(`import(${JSON.stringify(origin + mount + 'src/utils/router.js')}).then(m=>m.navigate(${JSON.stringify(route)}))`); await pause(450); };
|
|
|
+ const measureTitles = async () => evaluate(`(()=>{
|
|
|
+ const root=document.querySelector('kf-app').shadowRoot;
|
|
|
+ const headings=[root.querySelector('kf-topbar').shadowRoot.querySelector('h1'),...root.querySelector('main').firstElementChild.shadowRoot.querySelectorAll('[data-type-card] h3,.head h2')];
|
|
|
+ const canvas=document.createElement('canvas'),ctx=canvas.getContext('2d');
|
|
|
+ return headings.map(el=>{const s=getComputedStyle(el),r=el.getBoundingClientRect();ctx.font=s.fontWeight+' '+s.fontSize+' '+s.fontFamily;const glyph=ctx.measureText(el.textContent);return {text:el.textContent,height:r.height,glyphHeight:glyph.actualBoundingBoxAscent+glyph.actualBoundingBoxDescent,trim:s.textBoxTrim,clipped:r.height+0.5<glyph.actualBoundingBoxAscent+glyph.actualBoundingBoxDescent};});
|
|
|
+ })()`);
|
|
|
+ for (const width of [2048, 1280, 1024, 768, 390]) {
|
|
|
+ await cdp('Emulation.setDeviceMetricsOverride', { width, height: 1000, deviceScaleFactor: 1, mobile: width < 768 });
|
|
|
+ await legacyNavigate('/reports');
|
|
|
+ await evaluate('document.fonts.ready');
|
|
|
+ const headings = await measureTitles(); observations.push({ reportWidth: width, headings });
|
|
|
+ if (width === 2048 || width === 390) await shot('reports-typography-' + width);
|
|
|
+ check(`reports ${width}px: Chinese heading boxes retain the complete glyph height`, headings.length === 6 && headings.every(x => !x.clipped), headings);
|
|
|
+ check(`reports ${width}px: no page horizontal overflow`, await evaluate('document.documentElement.scrollWidth<=innerWidth+1'));
|
|
|
+ await evaluate(`document.querySelector('kf-app').shadowRoot.querySelector('view-reports').shadowRoot.querySelector('[data-type-card="voc"]').click()`); await pause(250);
|
|
|
+ const typeHeadings = await measureTitles();
|
|
|
+ check(`report category ${width}px: heading and classification retain full glyphs`, typeHeadings.length === 2 && typeHeadings.every(x => !x.clipped), typeHeadings);
|
|
|
+ check(`report category ${width}px: active tab is exposed correctly`, await evaluate(`document.querySelector('kf-app').shadowRoot.querySelector('view-report-type').shadowRoot.querySelector('.tab.cur').getAttribute('aria-current')==='page'`));
|
|
|
+ }
|
|
|
+ await cdp('Emulation.setDeviceMetricsOverride', { width: 1440, height: 1000, deviceScaleFactor: 1, mobile: false });
|
|
|
await legacyNavigate('/pool/fixture-report');
|
|
|
check('legacy wrong report link recovers to report route', await evaluate(`location.pathname==='/preview-test/report/fixture-report'&&Boolean(document.querySelector('kf-app').shadowRoot.querySelector('view-report'))`));
|
|
|
await legacyNavigate('/pool/fixture-opportunity');
|