fix(前端): 京东上架在架面板只留余量统计数——商品数据收进「管理」小入口(2026-11-28 客户口径「只要个统计数,不需要显示上架的数据」)
- 面板默认只显「当前在架 N/上限 M」一行,挂载即取数;「展开在架商品」「刷新」两按钮删 - 商品数据与「标记已下架」收进「管理」小入口,点开重取(读数与列表都新鲜),再点收起 - 「标记已下架」保留:它是腾额度的唯一界面出口(京麦人工下架系统感知不到),不能随列表一起删 - 满额琥珀提醒改经 quotaFullWarning 单出口,点名「管理」入口不再提「本列表」 - 判据:纯函数 9 支+mount 8 支全绿(含取数失败透出原文新格);反向验证两向(旧文案回流绊线红/数据默认常驻行为红)当场红逐字节复原 - 台账无涉:catch blocks 仍 339(两支 catch 形状未动)、JdOnShelfPanel 不在可读基线点名册
This commit is contained in:
@@ -5,20 +5,24 @@ import { join } from 'node:path'
|
||||
|
||||
import {
|
||||
clampPageSize,
|
||||
manageButtonLabel,
|
||||
markButtonLabel,
|
||||
markDelistedNotice,
|
||||
onShelfEmptyText,
|
||||
quotaFullWarning,
|
||||
quotaNearLimit,
|
||||
quotaReadoutText,
|
||||
} from '../src/pages/jd/jd-on-shelf.ts'
|
||||
|
||||
/**
|
||||
* 在架商品面板纯函数与接线绊线(2026-11-25 客户口径「上限=同时在架商品数,
|
||||
* 下架 10 个就能再上 10 个换着卖」)。
|
||||
* 在架面板纯函数与接线绊线(2026-11-25 客户口径「上限=同时在架商品数,
|
||||
* 下架 10 个就能再上 10 个换着卖」;2026-11-28 客户口径「只要个统计数,
|
||||
* 不需要显示上架的数据」——商品数据收进「管理」小入口,点开才见)。
|
||||
*
|
||||
* 绊线盯的是「安静地不做」类回退:面板绕过 api 模块裸拼 URL(落点台账失效)、
|
||||
* 文案在组件里硬拼(单出口失效)、JdPublishTab 不挂面板(功能整面失踪)——
|
||||
* 行为测试全绿也拦不住,只有源码绊线拦得住。
|
||||
* 文案在组件里硬拼(单出口失效)、旧「展开在架商品」大按钮回流(数据展示
|
||||
* 重新常驻界面)、JdPublishTab 不挂面板(功能整面失踪)——行为测试全绿也
|
||||
* 拦不住,只有源码绊线拦得住。
|
||||
*/
|
||||
|
||||
const ROOT = process.cwd()
|
||||
@@ -68,6 +72,15 @@ test('标记回执点名商品编码与确认义务,不写「操作成功」
|
||||
assert.equal(markButtonLabel(), '标记已下架')
|
||||
})
|
||||
|
||||
test('管理入口与满额提醒文案(2026-11-28 精简口径):入口只说「管理」,提醒点名「管理」不再提「本列表」', () => {
|
||||
assert.equal(manageButtonLabel(false), '管理')
|
||||
assert.equal(manageButtonLabel(true), '收起')
|
||||
assert.match(quotaFullWarning(), /额度已满/)
|
||||
assert.match(quotaFullWarning(), /「管理」/)
|
||||
assert.match(quotaFullWarning(), /标记已下架/)
|
||||
assert.ok(!quotaFullWarning().includes('本列表'), '列表已收进管理入口,「本列表」指路不得回流')
|
||||
})
|
||||
|
||||
// ---------------------------------------------------------- 源码绊线:接线与单出口
|
||||
|
||||
test('绊线:在架端点只在 endpoints.ts 登记一处,面板必须走 api 模块出口', () => {
|
||||
@@ -91,6 +104,10 @@ test('绊线:面板文案单出口——组件不硬拼「当前在架」,
|
||||
assert.match(panel, /quotaReadoutText/)
|
||||
assert.match(panel, /onShelfEmptyText/)
|
||||
assert.match(panel, /markDelistedNotice/)
|
||||
assert.match(panel, /manageButtonLabel/)
|
||||
assert.match(panel, /quotaFullWarning/)
|
||||
assert.doesNotMatch(panel, /展开在架商品/, '2026-11-28 精简口径:旧「展开在架商品」数据展示入口不得回流')
|
||||
assert.doesNotMatch(panel, /on-shelf-refresh/, '独立「刷新」按钮已删,余量随挂载与点开管理重取')
|
||||
})
|
||||
|
||||
test('绊线:JdPublishTab 必须挂上在架面板(功能整面失踪类回退)', () => {
|
||||
|
||||
Reference in New Issue
Block a user