Group dashboard activities under primary administration and tidy editorial overview
tests / ci (push) Waiting to run
tests / ci (push) Waiting to run
This commit is contained in:
@@ -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>/);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user