fix(profile): restore route styles and hidden modals
This commit is contained in:
@@ -283,3 +283,25 @@ test('article visual matrix pins every breakpoint, state and strict threshold',
|
||||
assert.equal(matrix.acceptance.dimensionDeltaPxMax, 1);
|
||||
assert.equal(matrix.acceptance.pixelDifferencePercentMax, 1.5);
|
||||
});
|
||||
|
||||
test('profile routes load versioned leaf styles and keep dialogs hidden initially', () => {
|
||||
const scripts = read('src/Core/ScriptsPart1b.php');
|
||||
const accountModals = read('inc/helpers/user-center-renderers/profile-account-modals.php');
|
||||
const userCenterJs = read('assets/js/routes/user-center.js');
|
||||
const userHomeCss = read('assets/css/routes/user-home.css');
|
||||
|
||||
assert.ok(scripts.includes("$profile_parts = ['layout', 'lists', 'modals'];"));
|
||||
for (const part of ['user-center/shell', 'user-center/credits', 'user-center/vip', 'user-center/level', 'user-center/settings', 'revenue', 'user-center/revenue', 'user-center/revenue-earnings', 'user-center/responsive']) {
|
||||
assert.ok(scripts.includes(`'${part}'`), `missing direct route leaf ${part}`);
|
||||
}
|
||||
assert.match(scripts, /assets\/css\/routes\/profile\/' \. \$part \. '\.css/);
|
||||
assert.match(scripts, /assets\/css\/routes\/' \. \$part \. '\.css/);
|
||||
assert.match(scripts, /filemtime\(\$part_path\)/);
|
||||
assert.doesNotMatch(scripts, /assets\/css\/routes\/profile\.css/);
|
||||
assert.doesNotMatch(scripts, /assets\/css\/routes\/user-center\.css/);
|
||||
|
||||
assert.match(accountModals, /id="pwd-modal" class="aksrt-modal" hidden/);
|
||||
assert.match(accountModals, /id="email-modal" class="aksrt-modal" hidden/);
|
||||
assert.match(userCenterJs, /function closeModal\(m\)[\s\S]*?m\.hidden = true;/);
|
||||
assert.match(userHomeCss, /\.aksrt-profile-details-modal\[hidden\]\s*\{\s*display:\s*none\s*!important;\s*\}/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user