修复导航栏用户卡片浮层的签到按钮

This commit is contained in:
kate522 committed 2026-08-20 14:43:18 +08:00
1 parent d27c0757f2
commit d69334b37d
7 files changed
+265 -198

No files matched your search

+17 -6
View File
@@ -195,10 +195,13 @@ test('notyf CSS and WordPress enqueue match the reference contract', () => {
test('balance center actions use direct fixed-id notyf flows', () => {
const credits = read('assets/js/credits.js');
const signinController = read('assets/js/signin.js');
const scripts = read('src/Core/ScriptsPart1b.php');
const css = read('assets/css/routes/user-center/credits.css');
const shell = read('assets/css/routes/user-center/shell.css');
const header = read('inc/helpers/user-center-renderers/profile-header.php');
const headerUserbox = read('inc/helpers/aksrt-header-userbox.php');
const signinService = read('src/Credits/Signin.php');
const signin = read('inc/helpers/user-center-renderers/credits-signin.php');
const context = read('inc/helpers/aksrt-user-center.php');
const renderers = [
@@ -217,7 +220,7 @@ test('balance center actions use direct fixed-id notyf flows', () => {
}
const flows = [
[section('initSignin', 'initSigninGoto'), 'aksrt-balance-signin-toast'],
[signinController, 'aksrt-balance-signin-toast'],
[section('initBalanceCharge', 'initTransfer'), 'aksrt-balance-charge-toast'],
[section('initTransfer', 'initPointsExchange'), 'aksrt-balance-transfer-toast'],
[section('initPointsExchange', 'initWithdraw'), 'aksrt-balance-points-toast'],
@@ -232,16 +235,24 @@ test('balance center actions use direct fixed-id notyf flows', () => {
});
assert.match(credits, /notyf\('等待支付结果…', 'load', '', 'aksrt-balance-charge-payment-toast'\)/);
assert.match(credits, /querySelectorAll\('\[data-signin-btn\]'\)/);
assert.match(credits, /freshButtons\.forEach[\s\S]*?addEventListener\('click'/);
assert.match(signinController, /querySelectorAll\('\[data-signin-btn\]'\)/);
assert.match(signinController, /freshButtons\.forEach[\s\S]*?addEventListener\('click'/);
assert.match(credits, /onTimeout:[\s\S]*?notyf\([^;]+?'danger'[^;]+?'aksrt-balance-charge-payment-toast'\)/);
assert.match(credits, /register\('credits',[\s\S]*?initSignin\(\);[\s\S]*?initBalanceCharge\(\);[\s\S]*?initTransfer\(\);[\s\S]*?initPointsExchange\(\);[\s\S]*?initWithdraw\(\);/);
assert.match(credits, /aksrtSigninInitialized[\s\S]*?aksrtPointsExchangeInitialized[\s\S]*?aksrtWithdrawInitialized/);
assert.match(credits, /register\('credits',[\s\S]*?initSigninGoto\(\);[\s\S]*?initBalanceCharge\(\);[\s\S]*?initTransfer\(\);[\s\S]*?initPointsExchange\(\);[\s\S]*?initWithdraw\(\);/);
assert.doesNotMatch(credits, /function initSignin\(|\/signin\/today|POST \/signin/);
assert.match(signinController, /aksrtSigninInitialized/);
assert.match(credits, /aksrtPointsExchangeInitialized[\s\S]*?aksrtWithdrawInitialized/);
assert.match(scripts, /'aksrt-credits',[\s\S]*?\/assets\/js\/credits\.js',[\s\S]*?\[[^\]]*'aksrt-notyf'[^\]]*\]/);
assert.match(scripts, /\$signin_on\s*=\s*is_user_logged_in\(\)[\s\S]*?'aksrt-signin',[\s\S]*?\/assets\/js\/signin\.js',[\s\S]*?'aksrt-core-request'[\s\S]*?'aksrt-notyf'/);
assert.ok(header.indexOf('data-signin-btn') < header.indexOf('uc-header__message-btn'));
assert.match(header, /uc-header__message-btn[^>]+aria-label="<\?php esc_attr_e\('消息通知'/);
assert.doesNotMatch(header, /<i class="fa fas fa-bell"[^>]*><\/i>\s*<\?php esc_html_e\('消息通知'/);
assert.match(header, /data-signin-captcha[\s\S]*?aksrt_render_captcha\('signin'\)/);
assert.doesNotMatch(header, /data-signin-captcha|aksrt_render_captcha\('signin'\)/);
assert.match(headerUserbox, /data-signin-btn[\s\S]*?data-signin-label/);
assert.match(headerUserbox, /add_action\('wp_footer', 'aksrt_render_signin_captcha'\)/);
assert.match(headerUserbox, /data-signin-captcha[\s\S]*?aksrt_render_captcha\('signin'\)/);
assert.match(signinService, /aksrt-checkin-modal__btn[^>]+data-signin-btn/);
assert.doesNotMatch(headerUserbox + signinService, /data-aksrt-checkin/);
assert.doesNotMatch(signin, /data-signin-captcha|aksrt_render_captcha/);
assert.match(context, /'signin_enabled'\s*=>\s*\$signin_enabled/);
assert.match(context, /'signin_signed_today'\s*=>\s*\$signin_signed_today/);