=== PERMISSION SYSTEM TEST SUITE ===

Running comprehensive tests...

TEST 1: Menu Items Have Valid Permissions
------------------------------------------------------------
✅ PASS: All menu items reference valid permissions

TEST 2: Controller Permissions Exist in Database
------------------------------------------------------------
✅ PASS: All 171 permissions used in controllers exist

TEST 3: All Roles Have Permissions
------------------------------------------------------------
⚠️  WARNING: 17 roles have no permissions:
  - Accounts Payable Manager (ID 70)
  - Accounts Receivable Manager (ID 72)
  - VP/Director of Sales (ID 76)
  - Customer Service Manager (ID 79)
  - Customer Service Representative (ID 80)
  - Purchasing Manager (ID 85)
  - Inventory Controller (ID 87)
  - VP/Director of Manufacturing (ID 88)
  - Quality Manager (ID 92)
  - Quality Inspector (ID 93)
  - HR Coordinator (ID 96)
  - Recruiting Manager (ID 97)
  - Payroll Manager (ID 99)
  - System Administrator (ID 100)
  - IT Manager (ID 101)
  - VP/Director of Business Development (ID 132)
  - VP/Director of Autonomous Systems (ID 133)

TEST 4: Permissions Are Grouped
------------------------------------------------------------
⚠️  WARNING: 503 permissions are not grouped:
  - projects.view: View projects
  - helpdesk.view: View help desk module
  - documents.view: View documents
  - messaging.view: View messaging module
  - marketing.view: View marketing module
  - analytics.view: View analytics
  - salesorders.view: View SALES
  - announcements.view: View Announcements
  - audit-logs.view: View Audit Log
  - backup.view: View System Backup
  ... and 493 more

TEST 5: Menu Permissions Match Controller Checks
------------------------------------------------------------
✅ PASS: Checked 20 menu items

TEST 6: No Duplicate Permission Names
------------------------------------------------------------
✅ PASS: No duplicate permission names found

TEST 7: All Users Have Valid Roles
------------------------------------------------------------
✅ PASS: All users have valid roles

=== TEST SUMMARY ===
Tests passed: 5 / 7
Errors: 0
Warnings: 18

⚠️  WARNINGS:
1. Role 'Accounts Payable Manager' has no permissions assigned
2. Role 'Accounts Receivable Manager' has no permissions assigned
3. Role 'VP/Director of Sales' has no permissions assigned
4. Role 'Customer Service Manager' has no permissions assigned
5. Role 'Customer Service Representative' has no permissions assigned
6. Role 'Purchasing Manager' has no permissions assigned
7. Role 'Inventory Controller' has no permissions assigned
8. Role 'VP/Director of Manufacturing' has no permissions assigned
9. Role 'Quality Manager' has no permissions assigned
10. Role 'Quality Inspector' has no permissions assigned
11. Role 'HR Coordinator' has no permissions assigned
12. Role 'Recruiting Manager' has no permissions assigned
13. Role 'Payroll Manager' has no permissions assigned
14. Role 'System Administrator' has no permissions assigned
15. Role 'IT Manager' has no permissions assigned
16. Role 'VP/Director of Business Development' has no permissions assigned
17. Role 'VP/Director of Autonomous Systems' has no permissions assigned
18. 503 permissions are not assigned to permission groups

⚠️  TESTS PASSED WITH WARNINGS