This commit is contained in:
2026-08-12 12:19:02 +08:00
parent f9ff9086d5
commit 11e085e30f
24 changed files with 230 additions and 50 deletions
@@ -194,12 +194,17 @@ describe('WarehousesView', () => {
})
expect(getPlatformWarehouse).not.toHaveBeenCalled()
expect(wrapper.text()).toContain('义乌收货仓')
expect(wrapper.text()).toContain('浙江省义乌市北苑街道 1 号库')
expect(wrapper.find('.data-table').text()).not.toContain('浙江省义乌市北苑街道 1 号库')
expect(wrapper.text()).toContain('国内收货仓')
expect(wrapper.text()).toContain('中国 CN')
expect(wrapper.text()).toContain('UTC+8')
expect(wrapper.find('.data-table').text()).not.toContain('UTC+8')
expect(wrapper.text()).toContain('共 1 个公共仓库')
expect(wrapper.find('.data-table').exists()).toBe(true)
const editButton = wrapper.findAll('.table-actions button').find((button) => button.text().trim() === '编辑')
await editButton?.trigger('click')
await flushPromises()
expect((wrapper.find('textarea[placeholder*="街道"]').element as HTMLTextAreaElement).value).toBe('真实物流园 1 号库')
expect(document.body.textContent).toContain('UTC+8')
})
it('submits filters and pagination to the API instead of filtering rows locally', async () => {
@@ -170,10 +170,10 @@ const warehouseColumns: DataTableColumn[] = [
{ key: 'warehouse', label: '仓库', minWidth: 190, slotName: 'warehouse' },
{ key: 'warehouseType', label: '仓库类型', width: 120, slotName: 'warehouseType' },
{ key: 'countryCode', label: '国家/地区', width: 140, slotName: 'countryCode' },
{ key: 'timezone', prop: 'timezone', label: '时区', width: 110 },
{ key: 'timezone', prop: 'timezone', label: '时区', width: 110, defaultVisible: false },
{ key: 'city', label: '所在城市', minWidth: 140, slotName: 'city' },
{ key: 'address', label: '地址', minWidth: 280, slotName: 'address' },
{ key: 'contact', label: '联系人', minWidth: 150, slotName: 'contact' },
{ key: 'address', label: '地址', minWidth: 280, slotName: 'address', defaultVisible: false },
{ key: 'contact', label: '联系人', minWidth: 150, slotName: 'contact', defaultVisible: false },
{ key: 'status', label: '状态', width: 100, slotName: 'status' },
]