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
@@ -16,6 +16,21 @@ test('navigation utils module exposes a factory', () => {
assert.equal(typeof api?.createNavigationUtils, 'function');
});
test('navigation utils recognize signup password pages for email and phone signup', () => {
const source = fs.readFileSync('background/navigation-utils.js', 'utf8');
const globalScope = {};
const api = new Function('self', `${source}; return self.MultiPageBackgroundNavigationUtils;`)(globalScope);
const utils = api.createNavigationUtils({
DEFAULT_CODEX2API_URL: 'http://localhost:8080/admin/accounts',
DEFAULT_SUB2API_URL: 'https://sub.example.com/admin/accounts',
normalizeLocalCpaStep9Mode: (value) => value,
});
assert.equal(utils.isSignupPasswordPageUrl('https://auth.openai.com/create-account/password'), true);
assert.equal(utils.isSignupPasswordPageUrl('https://auth.openai.com/log-in/password'), true);
assert.equal(utils.isSignupPasswordPageUrl('https://auth.openai.com/log-in'), false);
});
test('navigation utils treat 126 mail hosts as part of the shared NetEase mail family', () => {
const source = fs.readFileSync('background/navigation-utils.js', 'utf8');
const globalScope = {};