This commit is contained in:
2026-10-20 14:52:33 +08:00
parent 79482b4de8
commit 0e5a32616d
12 changed files with 23 additions and 23 deletions
+3 -3
View File
@@ -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 () => {