feat(qa): DEC-N4 把授权与 basis 门槛下沉成共用闸,既有两处转化区块同闸
只有新成果槽有反伪造门槛,CaseStudiesSection 与 detail-trust-section 没有 —— 同一类主张走两套标准,等于门槛只在新增位置有效。 - 新增 src/lib/constants/case-publish-gate.ts:判据(授权 + ≥1 个 basis==='verified' + 禁词扫描)下沉成一处实现,禁词/口径真源仍是 metrics-basis.ts; results-slot 的 casePublishBlockers 改为委托它 ⇒ 三处消费同一闸,无第二套真源。 - detail-case-studies-section / detail-trust-section 逐条过闸,被封条 console.error 喊出原因, 全封或空 ⇒ return null(L3EmptyFallback 契约不变)。 - dataProofs 不套 verified 硬闸:它已在 weakestBasis + MetricsBasisNote 契约下且自述目标口径, 硬清会误伤全站已标注数字(代码注释里写明理由)。 - 实测门槛下会隐藏的既有条目 = 0 条(seeds 里 caseStudies 全是空数组、 CMS dev.db 11 条内容的 caseStudies 长度全为 0)⇒ 线上转化页无可见变化, 这是前瞻性 fail-closed 加固,不是内容清洗。 - 转红的只有两处旧断言("未授权案例照常渲染"),按测试夹具补 authorized/basis 处理, 并新增负例。⚠ CMS content-types 的 caseStudies schema 还没有这两个字段, 业务要真出案例须先扩 schema —— 登记为残留。 仪器自证:把闸改成恒真(return [])⇒ EXIT=1、20 例转红(覆盖 gate 本体、results-slot 原有用例、 两区块负例、solution-detail 消费页);还原后 EXIT=0。 同批登记 §12.3 DEC-N3(判据从令牌声明移到消费点、8 条归零)与 §12.4(build 的 tsc 比 jest 严)。 读数:tsc EXIT=0、全量 jest 145 套件/1795 例 EXIT=0、check:visual EXIT=0、check:dead EXIT=0。
This commit is contained in:
1 parent
20d5cd0943
commit
2e0099426f
12 files changed
+574
-23
No files matched your search
@@ -122,6 +122,11 @@ describe('SolutionDetailContentV3 - L3 信任层三档策略', () => {
|
||||
challenge: '生产数据孤岛',
|
||||
solution: '部署 MES 与 BI',
|
||||
result: '生产效率提升 40%',
|
||||
// DEC-N4 同闸(2026-10-19):CaseStudiesSection 现与首页成果槽共用
|
||||
// case-publish-gate,条目须带授权 + verified 口径才渲染。
|
||||
// 下面两条负例断言的就是「不补这两维 ⇒ 本节不出」。
|
||||
verified: true,
|
||||
metrics: [{ value: '40%', label: '生产效率提升', basis: 'verified' }],
|
||||
},
|
||||
] as Solution['caseStudies'],
|
||||
};
|
||||
@@ -131,6 +136,27 @@ describe('SolutionDetailContentV3 - L3 信任层三档策略', () => {
|
||||
expect(screen.getByText('某制造集团')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('DEC-N4 同闸:未授权 / 缺已验证口径的案例条目不再渲染为「同行业落地案例」', () => {
|
||||
const withUngatedCases: Solution = {
|
||||
...baseSolution,
|
||||
caseStudies: [
|
||||
{
|
||||
client: '某制造集团',
|
||||
industry: '制造业',
|
||||
challenge: '生产数据孤岛',
|
||||
solution: '部署 MES 与 BI',
|
||||
result: '生产效率提升 40%',
|
||||
},
|
||||
] as Solution['caseStudies'],
|
||||
};
|
||||
const spy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
||||
render(<SolutionDetailContentV3 solution={withUngatedCases} />);
|
||||
|
||||
expect(screen.queryByText('同行业落地案例')).not.toBeInTheDocument();
|
||||
expect(screen.queryByText('某制造集团')).not.toBeInTheDocument();
|
||||
spy.mockRestore();
|
||||
});
|
||||
|
||||
it('renders certifications when data is available', () => {
|
||||
const withCerts: Solution = {
|
||||
...baseSolution,
|
||||
|
||||
Reference in new issue
Block a user