优化
This commit is contained in:
@@ -158,4 +158,26 @@ describe('ContainersView', () => {
|
||||
expect(source).toContain("if (nextPage !== previousPage || nextSize !== previousSize) void loadRows()")
|
||||
expect(source).not.toContain('@reset=')
|
||||
})
|
||||
|
||||
it('uses the frozen prototype modal contract for create and edit while retaining the detail drawer', () => {
|
||||
const source = readFileSync(resolve(process.cwd(), 'src/modules/container-loading/pages/ContainersView.vue'), 'utf8')
|
||||
expect(source).toContain('<AppDrawer v-model="detailOpen"')
|
||||
expect(source).toContain('<AppDialog v-model="editorOpen" class="container-editor-dialog"')
|
||||
expect(source).toContain('width="min(820px, calc(100vw - 28px))"')
|
||||
expect(source).toContain('max-height: 90vh')
|
||||
expect(source).toContain('overflow-y: auto')
|
||||
expect(source).toContain('grid-template-columns: minmax(0,1fr)')
|
||||
expect(source).not.toContain('<AppDrawer v-model="editorOpen"')
|
||||
})
|
||||
|
||||
it('keeps the prototype field sequence ahead of contract-only supplemental fields', () => {
|
||||
const source = readFileSync(resolve(process.cwd(), 'src/modules/container-loading/pages/ContainersView.vue'), 'utf8')
|
||||
const labels = ['集装箱号', '柜号', '装柜仓库', '提单号', '船名', '航次', '箱型(货柜类型)', '船公司', '起运港', '目的港', '目的仓', '货柜容量(m³)']
|
||||
let previous = -1
|
||||
for (const label of labels) {
|
||||
const current = source.indexOf(`label="${label}"`, previous + 1)
|
||||
expect(current, label).toBeGreaterThan(previous)
|
||||
previous = current
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user