feat(jd-database): v1.7 前端骨架——合并搜索+筛选弹层+回显条+自绘分页条+已选条

This commit is contained in:
2026-11-21 16:30:35 +08:00
parent 085c285446
commit 6685491fcb
6 changed files with 837 additions and 169 deletions
@@ -1,12 +1,15 @@
/**
* 京东数据库页(v1.6 装配:侧栏+卡片网格+居中详情弹窗)的挂载契约。
* 京东数据库页(v1.6 装配 → v1.7 对齐原型《商品数据商城》)的挂载契约。
*
* 形态:顶部通栏面板(筛选行:编码/标题/分组/同步起止/归属三档 + 工具栏:全选本页/
* 取消本页/归入分类/取消归属/删除商品(N),2026-11-21 用户口径「放到上面筛选框」红框
* 整体上移,不再住主面板)+横排体 .jd-body(左侧栏 JdCategorySidebar:商品目录=
* 京麦授权类目树+计数徽标+树外兜底/店铺分类=当前分组分类平铺+新建+分类管理入口
* +主面板:卡片网格 JdProductCard + OldPagination)+居中详情弹窗(编辑/删除入口
* 收进弹窗顶部)。
* 形态:顶部通栏面板(v1.7 搜索行:合并搜索框+「筛选」按钮+弹层锚点+分组+归属三档
* +工具栏:全选本页/取消本页/归入分类/取消归属/删除商品(N),2026-11-21 用户口径
* 「放到上面筛选框」红框整体上移,不再住主面板)+横排体 .jd-body(左侧栏
* JdCategorySidebar:商品目录=京麦授权类目树+计数徽标+树外兜底/店铺分类=当前分组
* 分类平铺+新建+分类管理入口+主面板:回显条+卡片网格 JdProductCard+自绘分页条
* .jd-page-bar+底部已选条)+居中详情弹窗(编辑/删除入口收进弹窗顶部)。
* v1.7 五件:合并搜索(旧编码/标题两框退役)、筛选弹层(价格区间+同步起止+重置/应用)、
* 筛选回显条(芯片+共 N 条+清除筛选保留分组)、自绘顶部分页条(OldPagination 从本页
* 撤下,组件本体他页在用)、底部已选条(常驻悬浮)。
* 旧表格/类目级联面板/详情抽屉三件随 v1.6 Phase 5 退役(反向钉在本文件顶部用例)。
* 批量归类对话框与分类管理对话框是 v1.6 之前的既有组件(另有专属 mount 契约文件),
* 本文件只钉页面接线(勾选累计/三参提交/打开路径/changed 重取)。
@@ -23,7 +26,6 @@ import { ElOption, ElSelect } from 'element-plus'
import JdDatabasePage from '@/pages/jd/JdDatabasePage.vue'
import JdProductEditDrawer from '@/pages/jd/JdProductEditDrawer.vue'
import OldPagination from '@/components/OldPagination.vue'
import { useAdminSessionStore } from '@/stores/admin-session'
@@ -195,6 +197,15 @@ async function pickSelectOption(wrapper: VueWrapper<Element>, label: string, opt
await flushPromises()
}
/** 打开筛选弹层(v1.7):点「筛选」按钮 toggle,返回弹层节点(弹层必须在 DOM)。 */
async function openFilterPopover(wrapper: VueWrapper<Element>): Promise<DOMWrapper<Element>> {
const trigger = wrapper.findAll('button').find((b) => b.text() === '筛选')
expect(trigger, '顶部应存在「筛选」按钮').toBeTruthy()
await trigger!.trigger('click')
await flushPromises()
return wrapper.get('.jd-filter-popover')
}
/** 详情弹窗取数 mock(已由 parseJdProductDetail 归一的形状)。 */
function detailPayload(id = 1) {
return {
@@ -213,7 +224,7 @@ function detailPayload(id = 1) {
}
describe('京东数据库页(v1.6 装配:侧栏+卡片网格)', () => {
it('挂载后按首屏分页参数取列表(pageSize 默认 50、档位 20/50/100、不带公司维度),卡片数=本页条数', async () => {
it('挂载后按首屏分页参数取列表(pageSize 默认 50、档位 50/100/200/500/1000、不带公司维度),卡片数=本页条数', async () => {
const wrapper = await mountWith({ items: [item(1), item(2), item(3)], total: 42, page: 1, pageSize: 50 })
expect(jdApi.fetchJdProductList).toHaveBeenCalledTimes(1)
const firstCall = jdApi.fetchJdProductList.mock.calls[0][0]
@@ -222,8 +233,8 @@ describe('京东数据库页(v1.6 装配:侧栏+卡片网格)', () => {
// 公司维度 2026-11-16 整页摘除:入参层不再有 companyId 键(单参 toHaveProperty 才是「键不存在」的真判据)。
expect(firstCall).not.toHaveProperty('companyId')
expect(wrapper.findAll('.jd-card')).toHaveLength(3)
// 档位 20/50/100 收敛在 filter 层常量:分页条下拉按它出选项。
expect(wrapper.findComponent(OldPagination).props('sizes')).toEqual([20, 50, 100])
// 档位 50/100/200/500/1000(v1.7 对齐原型)收敛在 filter 层常量:分页条下拉按它出选项。
expect(optionLabels(wrapper, '每页条数')).toEqual(['50条/页', '100条/页', '200条/页', '500条/页', '1000条/页'])
})
it('旧装配反钉:自绘表格/类目级联面板/详情抽屉三件已退役,批量入口改「归入分类」', async () => {
@@ -263,11 +274,12 @@ describe('京东数据库页(v1.6 装配:侧栏+卡片网格)', () => {
})
})
/** 布局钉(2026-11-21 用户口径「放到上面筛选框」红框整体上移):筛选行+批量按钮条
* 离开右侧主面板、提到页面最顶(操作提示条正下方、通栏整行);侧栏与主面板(只剩
* 网格+分页)归入横排体 .jd-body。反向钉死「改回主面板内」与「横排体散架」两种回归。 */
/** 布局钉(2026-11-21 用户口径「放到上面筛选框」红框整体上移;v1.7 主面板加回显条+
* 自绘分页条+已选条):筛选行+批量按钮条离开右侧主面板、提到页面最顶(操作提示条
* 正下方、通栏整行);侧栏与主面板(回显条+网格+分页条+已选条)归入横排体 .jd-body。
* 反向钉死「改回主面板内」与「横排体散架」两种回归。 */
describe('布局:筛选行+工具栏上移顶部通栏(2026-11-21 用户口径红框整体上移)', () => {
it('筛选行与工具栏同住顶部通栏面板且先于横排体;主面板只剩加载失败条+卡片网格+分页', async () => {
it('筛选行与工具栏同住顶部通栏面板且先于横排体;主面板=回显条+卡片网格+自绘分页条+已选条', async () => {
const wrapper = await mountWith({ items: [item(1)], total: 1, page: 1, pageSize: 50 })
const topPanel = wrapper.get('.jd-top-panel')
expect(topPanel.find('.jd-filter-row').exists()).toBe(true, '筛选行住顶部通栏面板')
@@ -277,7 +289,10 @@ describe('布局:筛选行+工具栏上移顶部通栏(2026-11-21 用户
expect(mainPanel.find('.jd-filter-row').exists()).toBe(false, '筛选行改回主面板即红')
expect(mainPanel.find('.jd-toolbar').exists()).toBe(false, '工具栏改回主面板即红')
expect(mainPanel.find('.jd-card-grid').exists()).toBe(true, '主面板=卡片网格')
expect(mainPanel.findComponent(OldPagination).exists()).toBe(true, '主面板=分页条')
expect(mainPanel.find('.jd-page-bar').exists()).toBe(true, '主面板=自绘分页条(v1.7 对齐原型)')
expect(mainPanel.find('.jd-select-bar').exists()).toBe(true, '主面板=底部已选条(v1.7 常驻)')
expect(mainPanel.text()).toContain('已选 0 件', '已选条常驻:0 件也显示(不随勾选数显隐)')
expect(mainPanel.find('.jd-filter-chips').exists()).toBe(false, '出厂态(默认未分类档)无激活筛选,回显条不渲染')
// 顺序与归属:页面根下先是顶部通栏面板、后是横排体;侧栏与主面板都在横排体里。
const viewChildren = [...wrapper.get('.jd-database-view').element.children]
@@ -502,11 +517,12 @@ describe('归属三档快筛(三档,默认卡未分类)', () => {
wrapper.unmount()
})
it('「重置」不放开筛选,而是回默认未分类档', async () => {
it('「重置」(弹层里)不放开筛选,而是回默认未分类档', async () => {
const wrapper = await mountWith({ items: [item(1)], total: 1, page: 1, pageSize: 50 })
await pickSelectOption(wrapper, '筛选分类状态', '已分类')
expect(jdApi.fetchJdProductList.mock.calls.at(-1)![0].classified).toBe('classified')
await openFilterPopover(wrapper)
await wrapper.findAll('button').find((b) => b.text() === '重置')!.trigger('click')
await flushPromises()
expect(jdApi.fetchJdProductList.mock.calls.at(-1)![0].classified).toBe('ungrouped',
@@ -858,82 +874,113 @@ describe('详情弹窗(抽屉退役后的详情入口)', () => {
})
})
describe('筛选与分页(AC-9:列表 HTTP 参数与 v1.4 逐字等价)', () => {
it('筛选生效:编码/关键字/分组分类/起止日期,查询回第一页重发(店铺/商品状态/导出已下线)', async () => {
describe('筛选与分页(v1.7:合并搜索+筛选弹层;AC-2/AC-4)', () => {
it('合并搜索+弹层条件生效:keyword/分组分类/起止日期一次下发,查询回第一页重发(旧两框停发)', async () => {
jdApi.fetchJdProductGroups.mockResolvedValue(GROUPS)
const wrapper = await mountWith({ items: [], total: 0, page: 1, pageSize: 50 })
const textInputs = wrapper.findAll('.form-group input[type="text"]')
expect(textInputs).toHaveLength(2, '商品编码+标题关键字两个文本筛选框(类目进侧栏、店铺/商品状态已下线)')
await textInputs[0].setValue('JD-1001')
await textInputs[1].setValue('保温杯')
// 分类筛选现在从侧栏店铺分类 Tab 来(旧「筛选店铺分类」下拉退役)。
// 合并搜索框(v1.7):一个框同时承载商品编码与标题(OR 语义在后端 SQL)。
const searchBox = wrapper.get('[aria-label="搜索商品"]')
expect(searchBox.attributes('placeholder')).toBe('搜索商品编码或标题')
await searchBox.setValue('保温杯')
// 分类筛选从侧栏店铺分类 Tab 来(旧「筛选店铺分类」下拉退役)。
await pickSideTab(wrapper, '店铺分类')
await sideRowBy(sideCustom(wrapper), '裙装').trigger('click')
await flushPromises()
// 同步起止收进筛选弹层(v1.7):开弹层→填日期→「应用」。
await openFilterPopover(wrapper)
const dateInputs = wrapper.findAll('input[type="date"]')
expect(dateInputs).toHaveLength(2, '弹层里同步起止两个日期框')
await dateInputs[0].setValue('2026-11-01')
await dateInputs[1].setValue('2026-11-09')
await wrapper.findAll('button').find((b) => b.text() === '查询')!.trigger('click')
await wrapper.findAll('button').find((b) => b.text() === '应用')!.trigger('click')
await flushPromises()
const last = jdApi.fetchJdProductList.mock.calls.at(-1)![0]
expect(last).toMatchObject({
productCode: 'JD-1001',
titleKeyword: '保温杯',
keyword: '保温杯',
groupId: '7',
syncedFrom: '2026-11-01',
syncedTo: '2026-11-09',
page: 1,
})
// 单参 toHaveProperty 才是「键不存在」的真判据(第二参会稀释成值断言):
// 页面 load() 入参已不带这三个键(店铺/商品状态筛选下线、公司维度 2026-11-16 摘除)。
expect(last).not.toHaveProperty('shopName')
// 旧编码/标题两框 v1.7 前端停发(合并进 keyword)、商品状态筛选下线、公司维度摘除。
// shopName 键 v1.7 随店铺名单回归页面入参层(空串=不限,序列化层不下发 shop_name)。
expect(last).not.toHaveProperty('productCode')
expect(last).not.toHaveProperty('titleKeyword')
expect(last.shopName).toBe('', '店铺入参空串=不限(Phase 3 侧栏点店铺行才带值)')
expect(last).not.toHaveProperty('saleStatus')
expect(last).not.toHaveProperty('companyId')
expect(wrapper.find('.jd-filter-popover').exists()).toBe(false, '「应用」后弹层收起')
wrapper.unmount()
})
it('重置把筛选面回空并回第一页重取(归属三档回未分类档、侧栏选中态清空)', async () => {
it('价格区间从弹层下发(AC-2):min/max 合法值随「应用」走查询;倒挡在门口拦下不发请求', async () => {
const wrapper = await mountWith({ items: [item(1)], total: 1, page: 1, pageSize: 50 })
const callsBefore = jdApi.fetchJdProductList.mock.calls.length
await openFilterPopover(wrapper)
await wrapper.get('[aria-label="最低价格"]').setValue('100')
await wrapper.get('[aria-label="最高价格"]').setValue('200')
await wrapper.findAll('button').find((b) => b.text() === '应用')!.trigger('click')
await flushPromises()
let last = jdApi.fetchJdProductList.mock.calls.at(-1)![0]
expect(last).toMatchObject({ minPrice: '100', maxPrice: '200', page: 1 },
'价格区间随「应用」下发(序列化层转 snake min_price/max_price)')
// 倒挡(100 > 200 形状反过来填):在弹层门口拦下,不发请求、弹层不收。
await openFilterPopover(wrapper)
await wrapper.get('[aria-label="最低价格"]').setValue('300')
await wrapper.get('[aria-label="最高价格"]').setValue('200')
const beforeInvalid = jdApi.fetchJdProductList.mock.calls.length
await wrapper.findAll('button').find((b) => b.text() === '应用')!.trigger('click')
await flushPromises()
expect(jdApi.fetchJdProductList.mock.calls.length).toBe(beforeInvalid, '倒挡不发请求')
expect(wrapper.find('.jd-filter-popover').exists()).toBe(true, '倒挡时弹层不收(让用户改数)')
expect(document.body.textContent).toContain('价格区间最小值不能大于最大值')
wrapper.unmount()
})
it('重置把筛选面回空并回第一页重取(入口在弹层里;归属三档回未分类档、侧栏选中态清空)', async () => {
jdApi.fetchJdProductGroups.mockResolvedValue(GROUPS)
const wrapper = await mountWith({ items: [], total: 0, page: 1, pageSize: 50 })
const textInputs = wrapper.findAll('.form-group input[type="text"]')
await textInputs[0].setValue('JD-1001')
await textInputs[1].setValue('保温杯')
await wrapper.get('[aria-label="搜索商品"]').setValue('保温杯')
await pickSideTab(wrapper, '店铺分类')
await sideRowBy(sideCustom(wrapper), '裙装').trigger('click')
await flushPromises()
expect(jdApi.fetchJdProductList.mock.calls.at(-1)![0]).toMatchObject({ groupId: '7' })
const callsBefore = jdApi.fetchJdProductList.mock.calls.length
await openFilterPopover(wrapper)
await wrapper.findAll('button').find((b) => b.text() === '重置')!.trigger('click')
await flushPromises()
expect(jdApi.fetchJdProductList.mock.calls.length).toBeGreaterThan(callsBefore)
const last = jdApi.fetchJdProductList.mock.calls.at(-1)![0]
expect(last).toMatchObject({ productCode: '', titleKeyword: '', groupId: '', category: '', page: 1 }, '重置后筛选全空、回第一页')
expect(last).toMatchObject({ keyword: '', groupId: '', category: '', page: 1 }, '重置后筛选全空、回第一页')
expect(wrapper.find('.jd-filter-popover').exists()).toBe(false, '重置后弹层收起')
expect(sideCustom(wrapper).findAll('.jd-side-row.selected')).toHaveLength(0, '侧栏分类选中态随重置清空')
expect(sideCustom(wrapper).findAll('.jd-side-row')).toHaveLength(2,
'重置只清筛选面:侧栏分类清单(当前组)保留,清选语义=再点已选行')
wrapper.unmount()
})
it('翻页与改每页条数都重发请求,改条数回第一页', async () => {
// total=120(50/页下三页):第 2 页的「下一页」要有第 3 页可去。
const wrapper = await mountWith({ items: [item(1)], total: 120, page: 2, pageSize: 50 })
it('翻页与改每页条数都重发请求,改条数回第一页(档位 50/100/200/500/1000)', async () => {
// total=520(50/页下 11 页):第 2 页的「下一页」要有第 3 页可去。
const wrapper = await mountWith({ items: [item(1)], total: 520, page: 2, pageSize: 50 })
await wrapper.findAll('button').find((b) => b.text() === '下一页')!.trigger('click')
await flushPromises()
expect(jdApi.fetchJdProductList).toHaveBeenCalledTimes(2)
expect(jdApi.fetchJdProductList.mock.calls[1][0].page).toBe(3)
// 每页条数下拉随分页条换 el-select(OldPagination 内局部注册):
// 点开→点选项,不再走原生 setValue;档位 20/50/100(v1.6 契约)。
// 每页条数下拉随自绘分页条(v1.7):点开→点选项,不走原生 setValue。
expect(wrapper.find('.page-size-select').exists()).toBe(true, '分页条下拉保留 .page-size-select 定位类')
await pickSelectOption(wrapper, '每页条数', '20条/页')
await pickSelectOption(wrapper, '每页条数', '200条/页')
await flushPromises()
const last = jdApi.fetchJdProductList.mock.calls.at(-1)![0]
expect(last.pageSize).toBe(20)
expect(last.pageSize).toBe(200)
expect(last.page).toBe(1, '改每页条数后回第一页')
wrapper.unmount()
})
@@ -946,6 +993,105 @@ describe('筛选与分页(AC-9:列表 HTTP 参数与 v1.4 逐字等价)',
wrapper.unmount()
})
it('顶部分页五键(v1.7 F4):首页/上一页/刷新/下一页/末页边界置灰,刷新重发当前页', async () => {
// 夹具回显请求的 page:load() 会把服务端回的 page 写回页面态(result.page>=1 即采信),
// 固定 page:2 的夹具会把「首页」点击后的页面态拉回第 2 页、刷新就不是当前页语义了。
jdApi.fetchJdProductList.mockImplementation((params: { page: number }) =>
Promise.resolve({ items: [item(params.page)], total: 120, page: params.page, pageSize: 50 }))
const wrapper = mount(JdDatabasePage, { global: { plugins: [pinia, ElSelect, ElOption] } })
await flushPromises()
await flushPromises()
// 先翻到第 2 页再验五键。
await wrapper.findAll('button').find((b) => b.text() === '下一页')!.trigger('click')
await flushPromises()
const bar = wrapper.get('.jd-page-bar')
expect(bar.get('.jd-page-info').text()).toBe('第 2 / 3 页 · 共 120 条', '页码信息条文案逐字同')
const btn = (text: string) => [...bar.findAll('button')].find((b) => b.text() === text)
expect(btn('首页')!.attributes('disabled')).toBeUndefined('第 2 页可回首')
expect(btn('上一页')!.attributes('disabled')).toBeUndefined()
expect(btn('下一页')!.attributes('disabled')).toBeUndefined()
expect(btn('末页')!.attributes('disabled')).toBeUndefined()
await btn('首页')!.trigger('click')
await flushPromises()
expect(jdApi.fetchJdProductList.mock.calls.at(-1)![0].page).toBe(1)
// 第 1 页:首页/上一页置灰;刷新重发当前页。
const callsBefore = jdApi.fetchJdProductList.mock.calls.length
await btn('刷新')!.trigger('click')
await flushPromises()
expect(jdApi.fetchJdProductList.mock.calls.length).toBe(callsBefore + 1, '刷新重发当前页')
expect(jdApi.fetchJdProductList.mock.calls.at(-1)![0].page).toBe(1)
expect(btn('首页')!.attributes('disabled')).toBeDefined('第 1 页首页置灰')
expect(btn('上一页')!.attributes('disabled')).toBeDefined()
await btn('末页')!.trigger('click')
await flushPromises()
expect(jdApi.fetchJdProductList.mock.calls.at(-1)![0].page).toBe(3, '末页直达第 3 页')
expect(btn('下一页')!.attributes('disabled')).toBeDefined('末页上下一页置灰')
expect(btn('末页')!.attributes('disabled')).toBeDefined()
wrapper.unmount()
})
it('筛选回显条(v1.7 F5):激活筛选出芯片+共 N 条+清除筛选;清除保留分组作用域(AC-4)', async () => {
jdApi.fetchJdProductGroups.mockResolvedValue(GROUPS)
const wrapper = await mountWith({ items: [item(1)], total: 7, page: 1, pageSize: 50 })
expect(wrapper.find('.jd-filter-chips').exists()).toBe(false, '出厂态(默认未分类档)不渲染回显条')
// 激活一批筛选:搜索词+侧栏分类+弹层价格区间+同步区间。
await wrapper.get('[aria-label="搜索商品"]').setValue('保温杯')
await pickSideTab(wrapper, '店铺分类')
await sideRowBy(sideCustom(wrapper), '裙装').trigger('click')
await flushPromises()
await openFilterPopover(wrapper)
await wrapper.get('[aria-label="最低价格"]').setValue('100')
await wrapper.get('[aria-label="最高价格"]').setValue('200')
await wrapper.get('[aria-label="同步开始日期"]').setValue('2026-11-01')
await wrapper.get('[aria-label="同步结束日期"]').setValue('2026-11-09')
await wrapper.findAll('button').find((b) => b.text() === '应用')!.trigger('click')
await flushPromises()
const chips = wrapper.get('.jd-filter-chips')
const chipText = chips.text()
expect(chipText).toContain('搜索:保温杯')
expect(chipText).toContain('分类:裙装', '侧栏分类选中按分类名回显(groupOptions 里查名,不裸显 id)')
expect(chipText).toContain('价格:100 ~ 200')
expect(chipText).toContain('同步:2026-11-01 ~ 2026-11-09')
expect(chipText).toContain('共 7 条', '「共 N 条」给行集规模')
expect(chips.get('.jd-chip-clear').text()).toBe('清除筛选')
// 清除筛选:筛选面回出厂(含三档回未分类),分组作用域保留。
await chips.get('.jd-chip-clear').trigger('click')
await flushPromises()
const last = jdApi.fetchJdProductList.mock.calls.at(-1)![0]
expect(last).toMatchObject({ keyword: '', groupId: '', minPrice: '', maxPrice: '', syncedFrom: '', syncedTo: '' },
'清除筛选后筛选面回空')
expect(last.ownerGroupId).toBe(11, '清除筛选保留分组作用域(分组是作用域不是筛选条件)')
expect(last.classified).toBe('ungrouped', '归属三档回默认未分类档')
expect(wrapper.find('.jd-filter-chips').exists()).toBe(false, '清除后回显条消失(无激活筛选)')
expect(sideCustom(wrapper).findAll('.jd-side-row.selected')).toHaveLength(0, '侧栏分类选中态随清除清空')
wrapper.unmount()
})
it('底部已选条(v1.7 F7 骨架):勾选随卡片勾选框累计,「已选 N 件」实时可见', async () => {
const wrapper = await mountWith({ items: [item(1), item(2)], total: 2, page: 1, pageSize: 50 })
const bar = wrapper.get('.jd-select-bar')
expect(bar.text()).toBe('已选 0 件')
await cardBoxes(wrapper)[0].setValue(true)
expect(wrapper.get('.jd-select-bar').text()).toBe('已选 1 件')
await cardBoxes(wrapper)[1].setValue(true)
expect(wrapper.get('.jd-select-bar').text()).toBe('已选 2 件')
// 批量删除成功清勾选后回 0(条常驻不消失)。
jdApi.deleteJdProducts.mockResolvedValueOnce({ deleted: 2, imagesDeleted: 0, objectsDeleted: 0, objectsKept: 0, objectsSkipped: 0 })
await toolbarBtn(wrapper, '全选本页').trigger('click')
await wrapper.get('.jd-delete-btn').trigger('click')
await flushPromises()
await flushPromises()
expect(wrapper.get('.jd-select-bar').text()).toBe('已选 0 件')
wrapper.unmount()
})
it('空态与加载失败条(失败给重试,不把整页打死)', async () => {
const empty = await mountWith({ items: [], total: 0, page: 1, pageSize: 50 })
const tip = empty.find('.jd-empty-tip')
@@ -1129,7 +1275,7 @@ describe('京东数据库分类按数据权限分组隔离(V203)', () => {
wrapper.unmount()
})
it('分组住进筛选行但仍是作用域不是筛选条件:重置只清筛选面,分组保持当前组', async () => {
it('分组住进筛选行但仍是作用域不是筛选条件:重置(弹层里)只清筛选面,分组保持当前组', async () => {
jdApi.fetchJdCategoryScope.mockResolvedValue({
platformSuperAdmin: true,
defaultGroupId: 11,
@@ -1142,6 +1288,7 @@ describe('京东数据库分类按数据权限分组隔离(V203)', () => {
await pickSelectOption(wrapper, '当前分组', '甲公司 / B组')
await flushPromises()
expect(jdApi.fetchJdProductList.mock.calls.at(-1)![0]).toMatchObject({ ownerGroupId: 12 })
await openFilterPopover(wrapper)
await wrapper.findAll('button').find((b) => b.text() === '重置')!.trigger('click')
await flushPromises()
expect(selectByLabel(wrapper, '当前分组').props('modelValue')).toBe(12, '重置不清当前分组(作用域语义,搬进筛选行也不变)')