fix(profile): align account dialogs and contracts

This commit is contained in:
2026-10-06 01:09:04 +08:00
parent f646fa8573
commit 248912f610
17 changed files with 1339 additions and 832 deletions
@@ -490,8 +490,9 @@ test('profile routes load versioned leaf styles and settings dialogs use the sha
assert.match(settingsAccount, /template data-aksrt-settings-modal-template="password"/);
assert.match(settingsAccount, /template data-aksrt-settings-modal-template="email"/);
assert.match(settingsAccount, /template data-aksrt-settings-modal-template="phone"/);
const settingsSubmitButtons = settingsAccount.match(/<button type="submit" class="but jb-blue padding-lg btn-block"[^>]*><i class="fa fas fa-check" aria-hidden="true"><\/i> <span data-aksrt-settings-submit-label><\?php esc_html_e\('确认提交', 'aksrt'\); \?><\/span><\/button>/g) || [];
assert.equal(settingsSubmitButtons.length, 3, 'password, email, and phone dialogs use the reference submit button with the FA5 icon');
assert.match(settingsAccount, /id="pwd-form"[\s\S]*?data-aksrt-settings-submit-label/);
assert.match(settingsAccount, /id="email-new-form"[\s\S]*?but jb-blue padding-lg btn-block/);
assert.match(settingsAccount, /id="aksrt-bind-phone-form"[\s\S]*?but jb-blue padding-lg btn-block/);
assert.doesNotMatch(settingsAccount, /aksrt-settings-modal__footer|确认修改|确认更改|确认绑定/);
assert.ok(settingsAccount.indexOf('绑定邮箱') < settingsAccount.indexOf('绑定手机'));
assert.ok(settingsAccount.indexOf('绑定手机') < settingsAccount.indexOf("require __DIR__ . '/settings-bindings.php'"));
@@ -504,13 +505,20 @@ test('profile routes load versioned leaf styles and settings dialogs use the sha
assert.match(userCenterJs, /className: 'aksrt-user-settings-modal modal-mini'/);
assert.match(userCenterJs, /mobileBottom: true/);
assert.match(userCenterJs, /onContent: function \(_, session\)/);
assert.match(userCenterJs, /aksrt:modal:close[\s\S]*?resetSettingsModal\(shell\)/);
assert.match(userCenterJs, /aksrt:modal:close[\s\S]*?resetSettingsModal\(event\.detail && event\.detail\.shell\)/);
assert.match(userCenterJs, /resetCaptcha\(scene, form\)/);
assert.match(userCenterJs, /function setSettingsSubmitLabel\(button, text\)[\s\S]*?label\.textContent = text/);
assert.match(userCenterJs, /setSettingsSubmitLabel\(submitBtn, submitIdleText\)/);
assert.match(userCenterJs, /aksrt_change_password/);
assert.match(userCenterJs, /aksrt_change_email/);
assert.match(userCenterJs, /AksrtModalRuntime\.close\('settings-submit'\)/);
assert.match(settingsAccount, /data-account-step="email-old"[\s\S]*?data-account-step="email-new"/);
assert.match(settingsAccount, /\$email_verify_required/);
assert.match(settingsAccount, /data-account-step="phone-old"[\s\S]*?data-account-step="phone-new"/);
assert.match(settingsAccount, /data-account-recovery-open[\s\S]*?data-account-password-pane="recovery"/);
assert.match(settingsAccount, /aksrt_render_captcha\('change_password'\)/);
assert.match(userCenterJs, /\/auth\/code/);
assert.match(userCenterJs, /\/auth\/reset-password/);
assert.match(userCenterJs, /\/user\/phone-verify/);
assert.doesNotMatch(settingsAccount + userCenterJs + settingsCss, /pwd-strength|pwd-send-code|email-send-code|aksrt_send_email_code/);
assert.match(settingsCss, /\.aksrt-modal-runtime\.aksrt-user-settings-modal:not\(\.aksrt-modal-runtime--bottom\)[\s\S]*?width: 400px/);
assert.match(settingsCss, /\.aksrt-settings-modal \.modal-colorful-header[\s\S]*?height: 120px/);
assert.match(settingsAccount, /class="colorful-make"/);