fix(jd-database): 归属快筛首屏文字改卡「全部」——placeholder 随默认档改词(2026-11-22 用户口径,补 0a769fa8 只改逻辑没改显示的漏改半边;el-select 对 '' 值显示 placeholder 故文案必须与默认档同词,挂载测试钉住灰字文案)

This commit is contained in:
2026-11-22 01:55:04 +08:00
parent fe479262e6
commit f742df9f20
2 changed files with 23 additions and 13 deletions
@@ -513,6 +513,13 @@ describe('归属三档快筛(三档,2026-11-21 用户口径默认改卡「
it('下拉三档且首屏就卡「全部」(首取不带 classified 键=后端跳过谓词查全量)', async () => {
const wrapper = await mountWith({ items: [item(1)], total: 1, page: 1, pageSize: 50 })
expect(optionLabels(wrapper, '筛选分类状态')).toEqual(['全部', '已分类', '未分类'])
// 首屏可见文案(2026-11-22 用户口径「文字也要改一下 默认全部」):'' 值被 el-select
// 按空值处理(useSelect.hasModelValue 把 '' 算空)⇒ 界面显示的是 placeholder 灰字,
// 不是「全部」选项的 label——placeholder 必须与默认档同词「全部」;写「未分类」=
// 逻辑已查全量、界面却谎称卡在未分类(0a769fa8 后的漏改半边)。
const placeholderEl = selectByLabel(wrapper, '筛选分类状态').find('.el-select__placeholder')
expect(placeholderEl.exists(), '归属快筛缺 placeholder 节点').toBe(true)
expect(placeholderEl.text()).toBe('全部')
expect(jdApi.fetchJdProductList.mock.calls[0][0]).not.toHaveProperty('classified',
'首屏默认档=全部——2026-11-21 用户口径「默认改成全部」(推翻 11-17 卡未分类)')
wrapper.unmount()
@@ -1381,16 +1388,16 @@ describe('首屏作用域同源与静默降级(Phase 0 黄金测试)', () =>
})
})
/** 店铺名单接线(v1.7 F6,2026-11-21 拍板「完整对齐」):侧栏点店铺行→列表按
/** 店铺名单接线(v1.7 F6,2026-11-21 拍板「完整对齐」;2026-11-22 铺开形态——名单
* 直接可见,挂载助手不再需要点开折叠箭头):侧栏点店铺行→列表按
* group_id+shop_name 成对过滤;行内改名/移除与分类行删除走对应 API;添加店铺弹窗
* 开合与批量提交。API 全部 mock(端点形状在 jd-product-api 与后端 controller 对撞)。 */
describe('店铺名单接线(v1.7:点店铺过滤+名单维护+添加店铺弹窗)', () => {
/** 挂载带名单的页面并展开裙装的名单。 */
/** 挂载带名单的页面(铺开形态:名单首屏直接可见)。 */
async function mountWithShops(): Promise<VueWrapper<Element>> {
jdApi.fetchJdProductGroups.mockResolvedValue(GROUPS)
const wrapper = await mountWith({ items: [item(1)], total: 1, page: 1, pageSize: 50 })
await pickSideTab(wrapper, '店铺分类')
await sideCustom(wrapper).get('[aria-label="展开或收起 裙装 的店铺名单"]').trigger('click')
await flushPromises()
return wrapper
}
@@ -1510,10 +1517,9 @@ describe('店铺名单接线(v1.7:点店铺过滤+名单维护+添加店
jdApi.fetchJdProductGroups.mockResolvedValue(GROUPS)
const wrapper = await mountWith({ items: [item(1)], total: 1, page: 1, pageSize: 50 })
await pickSideTab(wrapper, '店铺分类')
await sideCustom(wrapper).get('[aria-label="展开或收起 裙装 的店铺名单"]').trigger('click')
await flushPromises()
const custom = sideCustom(wrapper)
expect(custom.findAll('.jd-side-shop')).toHaveLength(2, '店铺行照常可见(读面)')
expect(custom.findAll('.jd-side-shop')).toHaveLength(2, '店铺行照常可见(读面,铺开态)')
expect(custom.find('.jd-side-shop-add').exists()).toBe(false, '只读档无添加店铺入口')
expect(custom.find('[aria-label="改名店铺 绿屿街道店"]').exists()).toBe(false)