commit9
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-30 20:02:30 +02:00
parent 6d14b4e6f0
commit c6373365bf
225 changed files with 15365 additions and 285 deletions
+26
View File
@@ -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()],