(fix):update user profile toast

This commit is contained in:
2026-08-18 03:27:42 +08:00
parent b556384025
commit e429b59077
7 changed files with 41 additions and 48 deletions
@@ -259,6 +259,26 @@ test('VIP purchase and points exchange use direct fixed-id notyf flows', () => {
assert.match(scripts, /'aksrt-pay-vip',[\s\S]*?\/assets\/js\/pay-vip\.js',[\s\S]*?\[[^\]]*'aksrt-notyf'[^\]]*\]/);
});
test('profile save uses AJAX rehydrate and a fixed-id notyf flow without query feedback', () => {
const profile = read('assets/js/routes/user-center.js');
const page = read('templates/pages/page-profile.php');
const form = read('inc/helpers/user-center-renderers/profile-form.php');
const layout = read('assets/css/routes/profile/layout.css');
const lists = read('assets/css/routes/profile/lists.css');
const scripts = read('src/Core/ScriptsPart1b.php');
assert.match(profile, /function initProfileForm\(root\)[\s\S]*?aksrtProfileInitialized[\s\S]*?addEventListener\('submit'/);
assert.match(profile, /register\('aksrt-profile-form',[\s\S]*?initProfileForm\(root\)/);
assert.match(profile, /notyf\([^;]+?'load'[^;]+?'aksrt-profile-save-toast'\);/);
assert.match(profile, /notyf\([^;]+?'success'[^;]+?'aksrt-profile-save-toast'\);/);
assert.match(profile, /notyf\([^;]+?'danger'[^;]+?'aksrt-profile-save-toast'\);/);
assert.match(profile, /fetch\(ajaxUrl, \{ method: 'POST', credentials: 'same-origin', body: data \}\)/);
assert.match(scripts, /\$user_center_deps[\s\S]*?\[[^\]]*'aksrt-notyf'[^\]]*\][\s\S]*?\/assets\/js\/routes\/user-center\.js/);
assert.doesNotMatch(page, /REQUEST_METHOD|profile_error|['"]saved['"]|add_query_arg/);
assert.doesNotMatch([profile, form, layout, lists].join('\n'), /profile-save-msg|profile-form__submit-msg/);
});
test('legacy frontend toast APIs and selectors are fully removed', () => {
const files = [
'assets/js',