优化
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 () => {
|
||||
|
||||
Reference in New Issue
Block a user