fix(jd): 后管京东数据库列表裁成部分字段(12 列),全量属性收进详情抽屉(B104)

This commit is contained in:
2026-11-15 04:27:48 +08:00
parent edc1772683
commit 9c8926068d
3 changed files with 36 additions and 36 deletions
@@ -98,28 +98,27 @@ describe('京东数据库页(v1.4 Phase 5)', () => {
expect(wrapper.find('.jd-summary').text()).toContain('共 42 条京东商品')
})
it('行内容与京麦后台列对齐:勾选/主图/标题/编码/货号/类目/品牌/信息分/SKU数/店铺/库存/价格/上架时间/状态/创建/修改/分组/同步(18 列)', async () => {
it('行内容只摆部分字段(B104 用户口径「外边列表部分字段」):勾选/主图/标题/编码/货号/品牌/价格/库存/状态/店铺/分组/同步(12 列),其余收进详情抽屉', async () => {
const wrapper = await mountWith({ items: [item(1)], total: 1, page: 1, pageSize: 20 })
const cells = wrapper.findAll('tbody tr')[0].findAll('td')
expect(cells).toHaveLength(18)
expect(cells).toHaveLength(12)
expect(cells[0].find('input[type="checkbox"]').exists()).toBe(true, '第 1 列是勾选框')
expect(cells[1].find('.jd-thumb').exists()).toBe(true, '第 2 列是主图')
expect(cells[2].text()).toContain('304不锈钢保温杯')
expect(cells[3].text()).toBe('JD-1001')
expect(cells[4].text()).toBe('ITEM-1', '货号列=京麦后台「货号」')
expect(cells[5].text()).toBe('家居 > 厨具 > 保温杯')
expect(cells[6].text()).toBe('锅宝')
expect(cells[7].text()).toBe('81', '信息分列')
expect(cells[8].text()).toBe('12', 'SKU 数列')
expect(cells[5].text()).toBe('锅宝')
expect(cells[6].text()).toBe('12.90 ~ 15.90', '价格区间=min ~ max')
expect(cells[7].text()).toBe('500', '总库存列')
expect(cells[8].text()).toBe('上架中')
expect(cells[9].text()).toBe('旗舰自营店')
expect(cells[10].text()).toBe('500', '总库存列')
expect(cells[11].text()).toBe('12.90 ~ 15.90', '价格区间=min ~ max')
expect(cells[12].text()).not.toBe('-', '上架时间格式化展示')
expect(cells[13].text()).toBe('上架中')
expect(cells[14].text()).not.toBe('-', '创建时间格式化展示')
expect(cells[15].text()).not.toBe('-', '修改时间格式化展示')
expect(cells[16].text()).toBe('甲组')
expect(cells[17].text()).not.toBe('-', '同步时间格式化展示')
expect(cells[10].text()).toBe('甲组')
expect(cells[11].text()).not.toBe('-', '同步时间格式化展示')
// 从列表撤下的字段不许出现在表头(全部收进详情抽屉,见下方抽屉断言)。
const headerText = wrapper.find('thead').text()
for (const gone of ['类目', '信息分', 'SKU', '上架时间', '创建时间', '修改时间']) {
expect(headerText).not.toContain(gone, `${gone}列已收进详情抽屉,不再上列表`)
}
expect(wrapper.find('.jd-thumb').exists()).toBe(true, '主图列渲染缩略图')
})
@@ -134,7 +133,7 @@ describe('京东数据库页(v1.4 Phase 5)', () => {
it('分组读不到的那行展示「未分组」(不猜名字)', async () => {
const wrapper = await mountWith({ items: [item(1, { groupId: null, groupName: '' })], total: 1, page: 1, pageSize: 20 })
expect(wrapper.findAll('tbody tr')[0].findAll('td')[16].text()).toBe('未分组')
expect(wrapper.findAll('tbody tr')[0].findAll('td')[10].text()).toBe('未分组')
})
it('筛选生效:店铺/编码/关键字/状态/分组/起止日期,查询回第一页重发', async () => {
@@ -293,6 +292,13 @@ describe('京东数据库页(v1.4 Phase 5)', () => {
expect(drawerText).toContain('ITEM-1')
expect(drawerText).toContain('信息分')
expect(drawerText).toContain('上架时间')
// B104:从列表撤下的字段(类目/SKU 数/京东创建/修改时间)+店铺/分组,详情里全量可见。
expect(drawerText).toContain('家居 > 厨具 > 保温杯')
expect(drawerText).toContain('SKU 数')
expect(drawerText).toContain('京东创建时间')
expect(drawerText).toContain('京东修改时间')
expect(drawerText).toContain('旗舰自营店')
expect(drawerText).toContain('甲组')
})
it('详情抽屉的销售属性=京麦那 12 行 SKU 矩阵:颜色/尺码两列维度 + 京东价 + 库存 + skuId', async () => {