Group dashboard activities under primary administration and tidy editorial overview
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-14 11:43:56 +02:00
parent ce8b744d1f
commit 73e1d7b964
12 changed files with 314 additions and 102 deletions
@@ -192,3 +192,17 @@ test('actual header has exactly the requested six primary entries on desktop and
),
);
});
test('authorised administration is primary and dashboard is a nested expandable group on desktop and mobile', () => {
for (mobile of [false, true]) {
state = {url: '/management/editorial', props: {auth: {user: {name: 'QA'}, canManagePortal: false}, dashboardNavigation: [{label: 'Visão geral', href: '/management/editorial'}, {label: 'Legislação', href: '/management/editorial?kind=legislation'}]}};
const html = renderToStaticMarkup(React.createElement(module.exports.PortalGroupedMenu));
const nav = html.match(/<nav[^>]*aria-label="Áreas do portal"[\s\S]*?<\/nav>/)?.[0];
assert.ok(nav);
const labels = [...nav.matchAll(/<(?:a|button)[^>]*class="tempo-nav-trigger"[^>]*>([\s\S]*?)<\/(?:a|button)>/g)].map(m => m[1].replace(/<[^>]*>/g, '').replace('Grupo actual', '').trim());
assert.deepEqual(labels, ['Início', 'Descoberta', 'Realização', 'Suporte', 'Administração', 'Sobre nós', 'Mais']);
assert.equal((nav.match(/href="\/management\/editorial"/g) ?? []).length, 1);
assert.match(nav, /Dashboard/);
if (mobile) assert.match(nav, /<summary[^>]*>Dashboard<\/summary>/);
}
});