20260929172211
This commit is contained in:
1 parent
ebeeca45b6
commit
f337ff1621
16 files changed
+1997
-134
No files matched your search
@@ -181,7 +181,12 @@ describe('fms-table 虚拟滚动验证', () => {
|
||||
await nextTick()
|
||||
await new Promise((r) => setTimeout(r, 100))
|
||||
const stkTable = wrapper.findComponent(StkTable)
|
||||
expect(stkTable.props('colResizable')).toBe(true)
|
||||
// 开启时统一传 { disabled } 回调(库只支持这种按列控制方式):普通列可拖,
|
||||
// 列上显式写 resizable: false 的(操作列 / 展开列)不拖
|
||||
const colResizable = stkTable.props('colResizable')
|
||||
expect(colResizable).toMatchObject({ disabled: expect.any(Function) })
|
||||
expect(colResizable.disabled({ dataIndex: 'c0', width: 120 })).toBe(false)
|
||||
expect(colResizable.disabled({ dataIndex: '__actions__', resizable: false })).toBe(true)
|
||||
expect(stkTable.props('headerDrag')).toBeTruthy()
|
||||
wrapper.unmount()
|
||||
})
|
||||
@@ -199,7 +204,9 @@ describe('fms-table 虚拟滚动验证', () => {
|
||||
await nextTick()
|
||||
|
||||
expect(wrapper.find('.fms-table').classes()).not.toContain('fms-table--auto-fit-width')
|
||||
expect(wrapper.findComponent(StkTable).props('colResizable')).toBe(true)
|
||||
expect(wrapper.findComponent(StkTable).props('colResizable')).toMatchObject({
|
||||
disabled: expect.any(Function),
|
||||
})
|
||||
wrapper.unmount()
|
||||
})
|
||||
|
||||
|
||||
@@ -63,13 +63,15 @@ describe('fms-module-list components', () => {
|
||||
en.unmount()
|
||||
})
|
||||
|
||||
it('快捷筛选网格列数按条件数收缩(只有一个条件时不占 4 列宽)', () => {
|
||||
it('快捷筛选列数按条件占用收缩(普通条件 200px 一列,区间/日期跨两列)', () => {
|
||||
const one = mount(FmsQuickFilters, {
|
||||
props: { items: [queryItem('b_name')], modelValue: {} },
|
||||
})
|
||||
expect(one.find('.quick-grid').element.style.gridTemplateColumns).toBe(
|
||||
'repeat(1, minmax(0, 288px))',
|
||||
'repeat(1, minmax(0, 200px))',
|
||||
)
|
||||
// 普通单值控件只占一列,不跨列
|
||||
expect(one.find('.quick-field').element.style.gridColumn).toBe('')
|
||||
one.unmount()
|
||||
|
||||
const four = mount(FmsQuickFilters, {
|
||||
@@ -79,9 +81,21 @@ describe('fms-module-list components', () => {
|
||||
},
|
||||
})
|
||||
expect(four.find('.quick-grid').element.style.gridTemplateColumns).toBe(
|
||||
'repeat(4, minmax(0, 288px))',
|
||||
'repeat(4, minmax(0, 200px))',
|
||||
)
|
||||
four.unmount()
|
||||
|
||||
// 日期区间(预设下拉 + 两端)跨两列:列数按占用列求和,宽控件不会被挤到下一行
|
||||
const mixed = mount(FmsQuickFilters, {
|
||||
props: { items: [rangeQueryItem('date'), queryItem('b_canuse')], modelValue: {} },
|
||||
})
|
||||
expect(mixed.find('.quick-grid').element.style.gridTemplateColumns).toBe(
|
||||
'repeat(3, minmax(0, 200px))',
|
||||
)
|
||||
const [wide, narrow] = mixed.findAll('.quick-field')
|
||||
expect(wide.element.style.gridColumn).toBe('span 2')
|
||||
expect(narrow.element.style.gridColumn).toBe('')
|
||||
mixed.unmount()
|
||||
})
|
||||
|
||||
it('快捷筛选「查询」提交草稿、「重置」交给页面处理', async () => {
|
||||
|
||||
@@ -216,7 +216,7 @@ describe('模块权限面板:权限点表(定宽 / 密集)', () => {
|
||||
|
||||
// colResizable + v-model:columns:表格按列宽定宽,拖过的列宽可回写
|
||||
const powerTable = wrapper.findAllComponents({ name: 'FmsTable' })[0]
|
||||
expect(powerTable.props('colResizable')).toBe(true)
|
||||
expect(powerTable.props('colResizable')).toMatchObject({ disabled: expect.any(Function) })
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -444,7 +444,7 @@ describe('绑定模块面板:权限区表头与表宽', () => {
|
||||
|
||||
// colResizable + v-model:columns:表格按列宽定宽(不自铺满整栏),拖过的列宽可回写
|
||||
const powerTable = wrapper.findAllComponents({ name: 'FmsTable' })[0]
|
||||
expect(powerTable.props('colResizable')).toBe(true)
|
||||
expect(powerTable.props('colResizable')).toMatchObject({ disabled: expect.any(Function) })
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user