This commit is contained in:
2026-08-12 15:23:18 +08:00
parent a01d2bbc9a
commit c15d21b986
4 changed files with 17 additions and 18 deletions
@@ -107,7 +107,7 @@ describe('CustomerDetailView', () => {
mount(CustomerDetailView, { attachTo: document.body, global: { plugins: [pinia, ElementPlus] } })
await flushPromises()
expect([...document.querySelectorAll('.detail-tabs button')].map((button) => button.textContent?.trim())).toEqual([
expect([...document.querySelectorAll('.detail-tabs button')].map((button) => button.getAttribute('aria-label'))).toEqual([
'基本信息', '业务概况', '运单记录', '计费规则',
])
expect(document.body.textContent).toContain('企业用户1人')
@@ -118,16 +118,14 @@ describe('CustomerDetailView', () => {
expect(document.body.textContent).toContain('已替换')
expect(document.body.textContent).toContain('12票')
const ordersTab = [...document.querySelectorAll<HTMLButtonElement>('.detail-tabs button')]
.find((button) => button.textContent?.trim() === '运单记录')
const ordersTab = document.querySelector<HTMLButtonElement>('.detail-tabs button[aria-label="运单记录"]')
ordersTab?.click()
await flushPromises()
expect(document.body.textContent).toContain('BY20260807001')
expect(document.body.textContent).toContain('海运整箱 FCL')
expect(listPlatformFirstLegOrders).toHaveBeenCalledWith({ tenantId: tenant.id, page: 1, size: 10 })
const billingTab = [...document.querySelectorAll<HTMLButtonElement>('.detail-tabs button')]
.find((button) => button.textContent?.trim() === '计费规则')
const billingTab = document.querySelector<HTMLButtonElement>('.detail-tabs button[aria-label="计费规则"]')
billingTab?.click()
await flushPromises()
expect(document.body.textContent).toContain('暂无尺寸计算规则查看权限')
@@ -143,8 +141,7 @@ describe('CustomerDetailView', () => {
mount(CustomerDetailView, { attachTo: document.body, global: { plugins: [pinia, ElementPlus] } })
await flushPromises()
const ordersTab = [...document.querySelectorAll<HTMLButtonElement>('.detail-tabs button')]
.find((button) => button.textContent?.trim() === '运单记录')
const ordersTab = document.querySelector<HTMLButtonElement>('.detail-tabs button[aria-label="运单记录"]')
ordersTab?.click()
await flushPromises()
@@ -174,8 +171,7 @@ describe('CustomerDetailView', () => {
await flushPromises()
expect(listPlatformFirstLegOrders).toHaveBeenCalledTimes(2)
const ordersTab = [...document.querySelectorAll<HTMLButtonElement>('.detail-tabs button')]
.find((button) => button.textContent?.trim() === '运单记录')
const ordersTab = document.querySelector<HTMLButtonElement>('.detail-tabs button[aria-label="运单记录"]')
ordersTab?.click()
await flushPromises()
const retryButton = [...document.querySelectorAll<HTMLButtonElement>('button')]