This commit is contained in:
2026-08-13 11:57:44 +08:00
parent 7beca3f985
commit 835ac0ad12
87 changed files with 3721 additions and 295 deletions
@@ -86,7 +86,7 @@ describe('TruckAppointmentsView', () => {
})
it('shows the two frequent row actions directly without a more menu', () => {
expect(source).toContain("v-if=\"access.can('platform:firstleg:truck-appointment:view')\"")
expect(source).not.toContain('platform:firstleg:truck-appointment:view')
expect(source).toContain("access.can('platform:firstleg:truck-appointment:edit') && ['DRAFT', 'PENDING_DISPATCH', 'RESCHEDULED'].includes(row.status)")
expect(source).toContain('<Eye :size="15" />详情')
expect(source).toContain('<Pencil :size="15" />编辑')
@@ -106,11 +106,11 @@ describe('TruckAppointmentsView', () => {
expect(wrapper.find('button[aria-label="编辑 TA-9001"]').exists()).toBe(false)
})
it('hides the detail action when the account lacks the backend view permission', async () => {
it('shows the detail action with the list permission', async () => {
useAuthStore().permissions = ['platform:firstleg:truck-appointment:list']
const wrapper = mount(TruckAppointmentsView, { global: { plugins: [ElementPlus] } })
await flushPromises()
expect(wrapper.find('button[aria-label="查看 TA-9001"]').exists()).toBe(false)
expect(wrapper.find('button[aria-label="查看 TA-9001"]').exists()).toBe(true)
})
it('prioritizes outbound business fields and keeps finance amounts out of the list', () => {