(fix):update user setting toast

This commit is contained in:
kate522 committed 2026-08-18 03:48:50 +08:00
1 parent e429b59077
commit 95553086dd
7 files changed
+156 -52

No files matched your search

@@ -279,6 +279,43 @@ test('profile save uses AJAX rehydrate and a fixed-id notyf flow without query f
assert.doesNotMatch([profile, form, layout, lists].join('\n'), /profile-save-msg|profile-form__submit-msg/);
});
test('settings actions use rehydrated fixed-id notyf flows', () => {
const userCenter = read('assets/js/routes/user-center.js');
const signRegister = read('assets/js/sign-register.js');
const settings = read('inc/helpers/user-center-renderers/profile-settings.php');
const context = read('inc/helpers/aksrt-user-center.php');
const page = read('templates/pages/page-profile.php');
[
'aksrt-settings-password-code-toast',
'aksrt-settings-email-code-toast',
'aksrt-settings-password-toast',
'aksrt-settings-email-toast',
'aksrt-settings-oauth-unbind-toast',
'aksrt-settings-phone-bind-toast',
].forEach((id) => assert.match(userCenter, new RegExp("['\"]" + id + "['\"]")));
assert.match(userCenter, /notyf\([^;]+?'load'[^;]+?toastId\);/);
assert.match(userCenter, /notyf\([^;]+?'success'[^;]+?toastId\);/);
assert.match(userCenter, /notyf\([^;]+?'danger'[^;]+?toastId\);/);
assert.match(userCenter, /register\('aksrt-settings',[\s\S]*?initSettings\(root\);[\s\S]*?initBindPhone\(root\);/);
assert.match(userCenter, /aksrtSettingsInitialized/);
assert.match(userCenter, /oauth_bound[\s\S]*?notyf\([^;]+?'success'\)[\s\S]*?history\.replaceState/);
assert.doesNotMatch(userCenter, /oauth_unbound/);
assert.match(signRegister, /scene === 'bind_phone'[\s\S]*?'aksrt-settings-phone-code-toast'/);
assert.match(signRegister, /notyf\('正在发送验证码…', 'load', '', toastId\)/);
assert.match(signRegister, /notyf\([^;]+?'success', 5, toastId\)/);
assert.match(signRegister, /notyf\([^;]+?'danger', 5, toastId\)/);
assert.match(signRegister, /register\('aksrt-sms-buttons',[\s\S]*?initSmsButtons\(root\)/);
assert.match(signRegister, /aksrtSmsInitialized/);
assert.match(settings, /require \$dir \. '\/profile-account-modals\.php';/);
assert.doesNotMatch(context, /account_modals_html|'account-modals'/);
assert.doesNotMatch(page, /user-center\/account-modals/);
assert.equal(fs.existsSync(path.join(root, 'templates/parts/user-center/account-modals.php')), false);
});
test('legacy frontend toast APIs and selectors are fully removed', () => {
const files = [
'assets/js',