fix(frontend): match navigation icon divider spacing
This commit is contained in:
1 parent
f019760297
commit
b520d29368
2 files changed
+25
-3
No files matched your search
@@ -51,6 +51,10 @@ foreach (['1', '2', '3'] as $layout) {
|
||||
ob_start(); aksrt_menu_button($ctx); $buttons = ob_get_clean();
|
||||
$results['desktop'][$layout][$userId] = $buttons;
|
||||
}
|
||||
$ctx['message_icon_positions'] = ['nav_menu'];
|
||||
$ctx['messages_url'] = 'https://example.test/messages';
|
||||
$ctx['unread_count'] = 3;
|
||||
ob_start(); aksrt_menu_button($ctx); $results['notifications'][$layout] = ob_get_clean();
|
||||
}
|
||||
foreach (['center', 'left'] as $mobileLayout) {
|
||||
$ctx = [
|
||||
@@ -101,6 +105,24 @@ test('mobile search appears in the centered header or left drawer according to l
|
||||
assert.match(output.mobile.left.drawer, /class="toggle-radius main-search-btn"/);
|
||||
});
|
||||
|
||||
test('account icons keep the reference spacing on both sides of each divider', () => {
|
||||
const output = renderHeaderParts();
|
||||
const lists = [
|
||||
...Object.values(output.desktop).flatMap((states) => Object.values(states)),
|
||||
...Object.values(output.notifications),
|
||||
];
|
||||
for (const html of lists) {
|
||||
const account = html.match(/<ul class="list-inline splitters relative">([\s\S]*?)<\/ul><\/div>/);
|
||||
assert.ok(account, 'missing the account action list');
|
||||
// Reference zib_menu_button concatenates the items directly. Whitespace
|
||||
// between inline-block li elements adds a font-dependent gap before the
|
||||
// following item's divider, beyond the shared 5px li / 12px button padding.
|
||||
assert.doesNotMatch(account[1], /<\/li>\s+<li\b/, 'extra text space shifts the divider');
|
||||
assert.doesNotMatch(account[1], /<\/li>\s+$/, 'trailing text space widens the action group');
|
||||
}
|
||||
assert.match(output.notifications['1'], /aksrt-nav-notification/);
|
||||
});
|
||||
|
||||
test('header source restores the reference typography and Bootstrap control dimensions', () => {
|
||||
const css = read('assets/css/frontend/header-userbox.css');
|
||||
const mainCss = read('assets/css/main.css');
|
||||
|
||||
Reference in new issue
Block a user