Reconciliar verificacoes com navegacao e relatorios aprovados
This commit is contained in:
@@ -2,6 +2,7 @@ import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import {
|
||||
portalNavigation,
|
||||
legacyPortalNavigation,
|
||||
currentNavigationGroup,
|
||||
currentNavigationItem,
|
||||
} from '../../resources/js/lib/portal-navigation.ts';
|
||||
@@ -15,7 +16,7 @@ void test('public and authenticated navigation share groups without revealing ma
|
||||
assert.deepEqual(publicGroups.slice(0, 3), investor.slice(0, 3));
|
||||
assert.deepEqual(
|
||||
publicGroups.map((g) => g.id),
|
||||
['explore', 'prepare', 'support', 'partnerships', 'account'],
|
||||
['discovery', 'realization', 'support', 'account'],
|
||||
);
|
||||
const hrefs = JSON.stringify(investor);
|
||||
assert.equal(hrefs.includes('/management/'), false);
|
||||
@@ -32,7 +33,7 @@ void test('management and optional modules follow permissions and feature flags'
|
||||
education: true,
|
||||
ai: true,
|
||||
});
|
||||
assert.equal(groups.at(-1).id, 'management');
|
||||
assert.ok(groups.some((group) => group.id === 'management'));
|
||||
assert.equal(JSON.stringify(groups).includes('/investidor/negocios'), true);
|
||||
assert.equal(JSON.stringify(groups).includes('/management/ai'), true);
|
||||
assert.equal(
|
||||
@@ -48,7 +49,9 @@ void test('management and optional modules follow permissions and feature flags'
|
||||
});
|
||||
|
||||
void test('detail URLs and filtered catalogue pages retain the current group', () => {
|
||||
const groups = portalNavigation({ authenticated: true, manager: true });
|
||||
// Preserve the retained catalogue's detail/filter matching independently
|
||||
// of the reconciled shell's new grouping names.
|
||||
const groups = legacyPortalNavigation({ authenticated: true, manager: true });
|
||||
for (const url of [
|
||||
'/carteira/project/fixture',
|
||||
'/zonas?category=zee',
|
||||
@@ -81,3 +84,11 @@ void test('detail URLs and filtered catalogue pages retain the current group', (
|
||||
'zee',
|
||||
);
|
||||
});
|
||||
|
||||
void test('reconciled navigation selects discovery, realization and private support correctly', () => {
|
||||
const groups = portalNavigation({ authenticated: false, manager: false });
|
||||
assert.equal(currentNavigationGroup(groups, '/oportunidades/fixture'), 'discovery');
|
||||
assert.equal(currentNavigationGroup(groups, '/simulador-fiscal'), 'realization');
|
||||
assert.equal(currentNavigationGroup(groups, '/balcao-virtual/dossiers/fixture'), 'support');
|
||||
assert.equal(currentNavigationGroup(groups, '/management/crm/leads'), null);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user