优化
This commit is contained in:
@@ -18,18 +18,18 @@ async function vueFiles(directory) {
|
||||
return files
|
||||
}
|
||||
|
||||
test('every editable PDA input and textarea provides an input hint', async () => {
|
||||
test('every editable PDA input and textarea provides a label or input hint', async () => {
|
||||
const missing = []
|
||||
for (const file of await vueFiles(sourceRoot)) {
|
||||
const source = await readFile(file, 'utf8')
|
||||
for (const match of source.matchAll(/<(input|textarea)\b[^>]*>/gs)) {
|
||||
if (!/\s:?placeholder\s*=/.test(match[0])) {
|
||||
if (!/\s:?(?:placeholder|aria-label)\s*=/.test(match[0])) {
|
||||
const line = source.slice(0, match.index).split('\n').length
|
||||
missing.push(`${relative(sourceRoot, file)}:${line}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
assert.deepEqual(missing, [], `缺少 placeholder:${missing.join(', ')}`)
|
||||
assert.deepEqual(missing, [], `缺少输入标签或提示:${missing.join(', ')}`)
|
||||
})
|
||||
|
||||
test('quantity inputs explain the valid package range', async () => {
|
||||
|
||||
@@ -130,7 +130,7 @@ test('relabel review opens a pending task as customer-confirmation read-only det
|
||||
assert.match(page, /<view v-else class="task-list">[\s\S]*@tap="openReview\(item\)"/)
|
||||
assert.match(page, /查看并复核/)
|
||||
assert.match(page, /async openReview\(item\)/)
|
||||
assert.match(page, /现场换标已经完成。请客户在客户工作台核对完工结果并确认/)
|
||||
assert.match(page, /现场换标已完成,等待客户确认/)
|
||||
assert.doesNotMatch(page, /@tap="review\('APPROVE'\)"/)
|
||||
assert.match(page, /<button v-if="stage !== 'review'" class="link-button"[^>]*@tap="bootstrap"/)
|
||||
assert.match(page, /if \(this\.stage === 'execute'\) this\.startScanner\(\)/)
|
||||
|
||||
Reference in New Issue
Block a user