feat: 更新密码页面识别逻辑,支持手机号注册和登录路径,并添加相关测试用例

This commit is contained in:
QLHazyCoder
2026-05-05 03:03:19 +08:00
parent 75bb53cec1
commit 1973f5a898
6 changed files with 192 additions and 7 deletions
+11
View File
@@ -51,6 +51,17 @@ function extractFunction(name) {
return source.slice(start, end);
}
test('signup password detector accepts create-account and phone login password paths', () => {
const run = (pathname) => new Function('location', `
${extractFunction('isSignupPasswordPage')}
return isSignupPasswordPage();
`)({ pathname });
assert.equal(run('/create-account/password'), true);
assert.equal(run('/log-in/password'), true);
assert.equal(run('/log-in'), false);
});
test('signup entry diagnostics summarizes current page inputs and visible actions', () => {
const api = new Function(`
const SIGNUP_ENTRY_TRIGGER_PATTERN = /免费注册|立即注册|注册|sign\\s*up|register|create\\s*account|create\\s+account/i;