fix(profile): match account submit buttons

This commit is contained in:
kate522 committed 2026-10-05 19:54:00 +08:00
1 parent 0a52bf36f9
commit 0cf4639d95
4 files changed
+52 -53

No files matched your search

@@ -490,6 +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.doesNotMatch(settingsAccount, /aksrt-settings-modal__footer|确认修改|确认更改|确认绑定/);
assert.ok(settingsAccount.indexOf('绑定邮箱') < settingsAccount.indexOf('绑定手机'));
assert.ok(settingsAccount.indexOf('绑定手机') < settingsAccount.indexOf("require __DIR__ . '/settings-bindings.php'"));
assert.ok(settingsAccount.indexOf("require __DIR__ . '/settings-bindings.php'") < settingsAccount.indexOf('账户密码'));
@@ -503,6 +506,8 @@ test('profile routes load versioned leaf styles and settings dialogs use the sha
assert.match(userCenterJs, /onContent: function \(_, session\)/);
assert.match(userCenterJs, /aksrt:modal:close[\s\S]*?resetSettingsModal\(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'\)/);