优化
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { resolve } from 'node:path'
|
||||
|
||||
const source = readFileSync(resolve(process.cwd(), 'src/modules/trucking/pages/TruckAppointmentDetailView.vue'), 'utf8')
|
||||
|
||||
describe('TruckAppointmentDetailView status contract', () => {
|
||||
it('matches the backend edit lifecycle and avoids a self-transition action', () => {
|
||||
expect(source).toContain('const targets: TruckAppointmentStatus[] =')
|
||||
expect(source).not.toContain('const targets: string[] =')
|
||||
expect(source).toContain("['DRAFT', 'PENDING_DISPATCH', 'RESCHEDULED'].includes(resource.value?.status || '')")
|
||||
expect(source).toContain("status !== resource.value?.status")
|
||||
expect(source).toContain("statuses.indexOf(status) === index")
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user