test: cover overseas row actions
This commit is contained in:
@@ -338,7 +338,13 @@ describe('overseas warehouse first-batch prototype contract', () => {
|
|||||||
for (const [fileName, routeName] of expected) {
|
for (const [fileName, routeName] of expected) {
|
||||||
const value = source(fileName)
|
const value = source(fileName)
|
||||||
expect(value).toContain(routeName)
|
expect(value).toContain(routeName)
|
||||||
expect(value).toMatch(/@click="openDetail\(row(?: as [^"]+)?\)">(?:<Eye :size="15" \/>)?查看<\/el-button>/)
|
if (fileName === 'DispatchesView.vue') {
|
||||||
|
expect(value).toContain('<RowActions :actions="rowActions(row as DispatchListItem)"')
|
||||||
|
expect(value).toContain("{ key: 'detail', label: '查看', priority: 300 }")
|
||||||
|
expect(value).toContain("if (command === 'detail') openDetail(row)")
|
||||||
|
} else {
|
||||||
|
expect(value).toMatch(/@click="openDetail\(row(?: as [^"]+)?\)">(?:<Eye :size="15" \/>)?查看<\/el-button>/)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user