优化
This commit is contained in:
@@ -14,6 +14,14 @@ describe('supplier formal pages', () => {
|
||||
expect(source).toContain("access.can('platform:supplier:edit')")
|
||||
expect(source).toContain("access.can('platform:supplier:status')")
|
||||
expect(source).toContain("access.can('platform:supplier:list')")
|
||||
expect(source).toContain('<el-button size="small" plain type="primary" @click="router.push')
|
||||
})
|
||||
|
||||
it('matches the prototype statistics, category tabs and search sequence', () => {
|
||||
expect(source).toContain('class="supplier-list-top"')
|
||||
expect(source).toContain('class="supplier-query-panel"')
|
||||
expect(source).toContain('class="supplier-query-toolbar"')
|
||||
expect(source).toContain('grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px')
|
||||
})
|
||||
|
||||
it('uses independent routes for list, detail, create and edit', () => {
|
||||
@@ -34,4 +42,11 @@ describe('supplier formal pages', () => {
|
||||
expect(formSource).toContain('<ApiErrorMeta')
|
||||
expect(detailSource).toContain('<ApiErrorMeta')
|
||||
})
|
||||
|
||||
it('reloads detail data when the reused route id changes and protects the newer request', () => {
|
||||
expect(detailSource).toContain("watch(supplierId, () => { void load() }, { immediate: true })")
|
||||
expect(detailSource).toContain('const requestedId = supplierId.value')
|
||||
expect(detailSource).toContain('if (sequence !== loadSequence || requestedId !== supplierId.value) return')
|
||||
expect(detailSource).toContain("params: { id: supplier.id }")
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user