修复新增客户端授权码表单无法回车提交

This commit is contained in:
xuans committed 2026-10-02 21:37:58 +08:00
1 parent e2cc192136
commit 2dd385d2c4
2 files changed
+15 -2

No files matched your search

+9
View File
@@ -46,3 +46,12 @@ test('客户端凭据操作验证本人密码且保留密码空白字符', () =>
assert.match(source, /if \(verifyLoading\.value\) return/)
assert.match(source, /finally \{\s+verifyPassword\.value = ''/)
})
test('新增客户端使用原生表单提交且保留防重复提交保护', () => {
const source = read('js')
const template = read('vue')
assert.match(template, /<el-form\s+id="client-credential-create-form"\s+@submit\.prevent="submitCreateClient"/)
assert.match(template, /native-type="submit"\s+form="client-credential-create-form"/)
assert.doesNotMatch(template, /@click="submitCreateClient"|@key(?:down|up)\.enter[^=]*="submitCreateClient"/)
assert.match(source, /const submitCreateClient = async \(\) => \{\s+if \(createLoading\.value\) return/)
})