> digiboxy-accounting-backend@1.0.0 test > cross-env NODE_ENV=test jest company-permissions.test.js node.exe : (node:13328) [DEP0170] DeprecationWarning: The URL sqlite::memory: is invalid. Future versions of Node.js will throw an error. At C:\Program Files\nodejs\npm.ps1:29 char:3 + & $NODE_EXE $NPM_CLI_JS $args + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: ((node:13328) [D...throw an error.:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError (Use `node --trace-deprecation ...` to show where the warning was created) console.log ✓ Database connection has been established successfully. at log (src/config/database.js:55:13) FAIL src/tests/integration/company-permissions.test.js Company-Level Permissions User with different roles across companies √ User can create account in Company A (Admin role) (39 ms) × User CANNOT create account in Company B (Viewer role) (19 ms) User-Company Management √ Admin can assign user to company with role (30 ms) √ Admin can update user role in company (21 ms) × Cannot remove last admin from company (27 ms) √ Admin can remove user from company (16 ms) UserCompanies Query × User can query their company-role assignments (23 ms) ● Company-Level Permissions › User with different roles across companies › User CANNOT create account in Company B (Viewer role) expect(received).toBeDefined() Received: undefined   183 | });  184 | > 185 | expect(res.body.errors).toBeDefined();  | ^  186 | expect(res.body.errors[0].message).toContain('Insufficient permissions');  187 | });  188 | }); at Object.toBeDefined (src/tests/integration/company-permissions.test.js:185:31) ● Company-Level Permissions › User-Company Management › Cannot remove last admin from company expect(received).toBeDefined() Received: undefined   279 | });  280 | > 281 | expect(res.body.errors).toBeDefined();  | ^  282 | expect(res.body.errors[0].message).toContain('at least one admin');  283 | });  284 | at Object.toBeDefined (src/tests/integration/company-permissions.test.js:281:31) ● Company-Level Permissions › UserCompanies Query › User can query their company-role assignments expect(received).toBe(expected) // Object.is equality Expected: "admin" Received: "viewer"   341 | uc => uc.company.name === 'Company A'  342 | ); > 343 | expect(companyARoles.role.code).toBe('admin');  | ^  344 |  345 | const companyBRoles = res.body.data.me.userCompanies.find(  346 | uc => uc.company.name === 'Company B' at Object.toBe (src/tests/integration/company-permissions.test.js:343:39) Test Suites: 1 failed, 1 total Tests: 3 failed, 4 passed, 7 total Snapshots: 0 total Time: 3.037 s Ran all test suites matching company-permissions.test.js.