29 lines
1.2 KiB
TypeScript
29 lines
1.2 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|||
|
|
import { readFileSync } from 'node:fs'
|
||
|
|
import { resolve } from 'node:path'
|
||
|
|
|
||
|
|
const source = readFileSync(resolve(process.cwd(), 'src/modules/loading-lists/pages/PreloadPlanDetailView.vue'), 'utf8')
|
||
|
|
|
||
|
|
describe('PreloadPlanDetailView prototype contract', () => {
|
||
|
|
it('is a formal responsive detail page with a return action', () => {
|
||
|
|
expect(source).toContain('<AdminPage>')
|
||
|
|
expect(source).toContain('返回列表')
|
||
|
|
expect(source).toContain('<ArrowLeft')
|
||
|
|
expect(source).toContain("router.push({ name: 'loading-plans' })")
|
||
|
|
expect(source).not.toContain('AppDrawer')
|
||
|
|
})
|
||
|
|
|
||
|
|
it('requires the real warehouse context and preserves status boundaries', () => {
|
||
|
|
expect(source).toContain('MISSING_WAREHOUSE_CONTEXT')
|
||
|
|
expect(source).toContain("['EDITING', 'LOADING'].includes(result.summary.status)")
|
||
|
|
expect(source).toContain('MODE_STATUS_MISMATCH')
|
||
|
|
})
|
||
|
|
|
||
|
|
it('uses the real optimistic-lock transport endpoint without inventing note writes', () => {
|
||
|
|
expect(source).toContain('updatePreloadTransport')
|
||
|
|
expect(source).toContain('expectedVersion: detail.value.summary.version')
|
||
|
|
expect(source).toContain('width="min(620px, calc(100vw - 28px))"')
|
||
|
|
expect(source).not.toContain('saveMfNote')
|
||
|
|
})
|
||
|
|
})
|