@@ -24,6 +24,18 @@ for (const role of [
|
||||
]) {
|
||||
for (const payables of [false, true]) {
|
||||
const groups = procurementNavigation(role, payables);
|
||||
assert.ok(
|
||||
groups.length <= 6,
|
||||
'Navigation must stay within six related functional groups',
|
||||
);
|
||||
const ids = groups.flatMap((group) =>
|
||||
group.entries.map((entry) => entry.id),
|
||||
);
|
||||
assert.equal(
|
||||
new Set(ids).size,
|
||||
ids.length,
|
||||
'Navigation entries must not be duplicated',
|
||||
);
|
||||
for (const group of groups)
|
||||
for (const entry of group.entries) {
|
||||
const uri = new URL(entry.path, 'http://local').pathname.slice(
|
||||
@@ -68,6 +80,19 @@ for (const role of [
|
||||
const configuredFinance = procurementNavigation(['finance'], false).flatMap(
|
||||
(g) => g.entries,
|
||||
);
|
||||
const separate = procurementNavigation('admin', true);
|
||||
assert.ok(separate.find((group) => group.id === 'purchasing').entries.every((entry) => !entry.path.startsWith('/pessoas')));
|
||||
assert.ok(separate.find((group) => group.id === 'people').entries.every((entry) => entry.path.startsWith('/pessoas')));
|
||||
for (const permission of ['people_service_prepare','people_service_review','people_staff_prepare','people_staff_review']) {
|
||||
const entries = procurementNavigation([permission], false).flatMap((group) => group.entries);
|
||||
assert.equal(entries.some((entry) => entry.id === 'people_hiring'), true);
|
||||
assert.equal(entries.some((entry) => entry.id === 'company' || entry.id === 'invoices' || entry.id === 'new_request'), false);
|
||||
}
|
||||
for (const permission of ['people_registry_read','people_registry_manage']) {
|
||||
const entries = procurementNavigation([permission],false).flatMap((group)=>group.entries);
|
||||
assert.equal(entries.some((entry)=>entry.id==='people_registry'),true);
|
||||
assert.equal(entries.some((entry)=>entry.id==='people_hiring'),false);
|
||||
}
|
||||
assert.equal(
|
||||
configuredFinance.some((e) => e.id === 'organization_parameters'),
|
||||
false,
|
||||
@@ -94,6 +119,7 @@ const proof = {
|
||||
entries: rows.size,
|
||||
roles: 6,
|
||||
configurable_permissions_and_multiple_profiles: true,
|
||||
maximum_functional_groups: 6,
|
||||
source: 'procurementNavigation compared with actual Laravel GET routes',
|
||||
scope: 'Menu routing, active entry and visibility contract; not a substitute for functional or visual workflow acceptance',
|
||||
rows: [...rows.values()],
|
||||
|
||||
Reference in New Issue
Block a user