This commit is contained in:
2026-09-15 09:58:15 +08:00
parent 3f998bdb88
commit 4bf66d9571
90 changed files with 1599 additions and 1388 deletions
@@ -111,17 +111,19 @@ describe('FinanceCustomerStatementsView', () => {
expect(document.querySelectorAll('.statement-summary-grid .statement-summary-item')).toHaveLength(20)
expect(document.querySelector('[aria-label="对账单摘要"]')?.textContent).toContain('客户确认人')
expect(document.querySelector('[aria-label="对账单摘要"]')?.textContent).toContain('2026-08-05 10:00')
expect(document.querySelector('.statement-detail-head')?.textContent).toContain('REC-501')
expect(document.querySelector('.density-detail-heading')?.textContent).toContain('REC-501')
expect(document.querySelector('[aria-label="客户对账单账单明细"]')).toBeTruthy()
expect(document.querySelector('.detail-table-scroll [aria-label="客户对账单账单明细"]')).toBeTruthy()
expect(document.querySelector('.el-drawer')).toBeNull()
})
it('uses the prototype-style wide summary grid at 1920px', () => {
it('uses the shared four-group summary grid with long remarks spanning two groups', () => {
const source = readFileSync(resolve(process.cwd(), 'src/modules/finance/pages/FinanceCustomerStatementsView.vue'), 'utf8')
expect(source).toContain('grid-template-columns: repeat(auto-fit, minmax(220px, 1fr))')
expect(source).toContain('grid-template-columns: repeat(5, minmax(0, 1fr))')
expect(source).not.toContain('<el-descriptions :column="3" border>')
const shared = readFileSync(resolve(process.cwd(), 'src/styles/adminDensity.css'), 'utf8')
const moduleCss = readFileSync(resolve(process.cwd(), 'src/modules/finance/financeDensity.css'), 'utf8')
expect(source).toContain('class="density-fields statement-summary-grid"')
expect(shared).toContain('repeat(4, minmax(0, 1fr))')
expect(moduleCss).toContain('.statement-summary-item--remark { grid-column: span 2; }')
})
it('uses entity buttons for row actions and only folds the fourth action into more', () => {
@@ -130,9 +132,10 @@ describe('FinanceCustomerStatementsView', () => {
expect(actions).not.toContain(' link')
for (const label of ['详情', '提交', '通过', '驳回', '出账', '调整', '重开']) {
const actionLine = actions.split('\n').find((line) => line.includes(`${label}</el-button>`))
expect(actionLine).toContain('size="small" plain type="primary"')
expect(actionLine).toContain('class="density-action"')
expect(actionLine).toContain('size="small"')
}
expect(actions).toContain('size="small" plain type="danger"')
expect(actions).toContain('data-tone="danger"')
expect(actions).toContain('aria-label="更多对账单操作" title="更多对账单操作"')
expect(actions).toContain("row.status === 'PENDING_REVIEW' && canReview && canVoid")
expect(actions.match(/<el-dropdown-item/g)).toHaveLength(1)
@@ -151,10 +154,10 @@ describe('FinanceCustomerStatementsView', () => {
const voidButton = actionButtons.find((button) => button.textContent?.trim() === '作废')
expect(new Set(actionButtons.map((button) => button.textContent?.trim()))).toEqual(new Set(['详情', '调整', '作废']))
expect(detailButton?.classList).toContain('el-button--small')
expect(detailButton?.classList).toContain('is-plain')
expect(detailButton?.classList).toContain('el-button--primary')
expect(adjustButton?.classList).toContain('el-button--primary')
expect(voidButton?.classList).toContain('el-button--danger')
expect(detailButton?.classList).toContain('density-action')
expect(detailButton?.getAttribute('data-tone')).toBe('neutral')
expect(adjustButton?.classList).toContain('density-action')
expect(voidButton?.getAttribute('data-tone')).toBe('danger')
const vm = wrapper.vm as unknown as { actionBusy: boolean; adjustBusy: boolean }
vm.actionBusy = true
@@ -302,7 +305,7 @@ describe('FinanceCustomerStatementsView', () => {
lastPaymentFrom: '2026-08-20', lastPaymentTo: '2026-08-21',
},
})
expect(showExportTaskCreatedDialog).toHaveBeenCalledWith({ taskName: '客户对账单', taskNo: 'EXP-STMT-1' })
expect(showExportTaskCreatedDialog).toHaveBeenCalledWith({ taskName: '客户对账单', taskNo: 'EXP-STMT-1', dense: true })
expect(getReconciliationStatement).not.toHaveBeenCalledWith('501')
expect(URL.createObjectURL).not.toHaveBeenCalled()
})
@@ -399,7 +402,7 @@ describe('FinanceCustomerStatementsView', () => {
const { router } = await mountPage(['platform:finance:customer-statement:list'], '/finance/customer-statements/501')
await flushPromises()
expect(router.currentRoute.value.name).toBe('finance-customer-statement-detail')
expect(document.body.textContent).toContain('客户对账单详情')
expect(document.querySelector('[aria-label="客户对账单详情"]')).toBeTruthy()
expect(document.body.textContent).toContain('返回客户对账单')
expect(document.body.textContent).toContain('明细加载失败')
expect(document.body.textContent).toContain('重试')