
Running 1 test using 1 worker

[1A[2K[1/1] [chromium] ΓÇ║ tests\user-system-management.spec.ts:253:5 ΓÇ║ V. User & System Management ΓÇ║ 5.7. B. Admin Panel - View User List
[1A[2K[chromium] ΓÇ║ tests\user-system-management.spec.ts:253:5 ΓÇ║ V. User & System Management ΓÇ║ 5.7. B. Admin Panel - View User List
Promoting user test.user.yuinwb@example.com to ADMIN...

node.exe : [1A[2KError promoting user test.user.yuinwb@example.co
m to ADMIN: Error: Command failed: npx ts-node promote_admin.ts tes
t.user.yuinwb@example.com
At C:\Program Files\nodejs\npx.ps1:29 char:3
+   & $NODE_EXE $NPX_CLI_JS $args
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: ([1A[2KError p...nwb 
   @example.com:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
Error: PrismaClientKnownRequestError: 
Invalid `prisma.user.update()` invocation in
D:\Coding\gymflow\server\promote_admin.ts:22:27

  19 const found = await prisma.user.findUnique({ where: { email } 
});
  20 console.log('User found check:', found ? 'YES' : 'NO');
  21 
ΓåÆ 22 await prisma.user.update(
An operation failed because it depends on one or more records that 
were required but not found. No record was found for an update.
    at qr.handleRequestError [90m(D:\Coding\gymflow\server\[39mno
de_modules\[4m@prisma[24m\client\src\runtime\RequestHandler.ts:22
8:13[90m)[39m
    at qr.handleAndLogRequestError [90m(D:\Coding\gymflow\server\
[39mnode_modules\[4m@prisma[24m\client\src\runtime\RequestHandler
.ts:174:12[90m)[39m
    at qr.request [90m(D:\Coding\gymflow\server\[39mnode_modules\
[4m@prisma[24m\client\src\runtime\RequestHandler.ts:143:12[90m)
[39m
[90m    at processTicksAndRejections (node:internal/process/task_q
ueues:105:5)[39m
    at async a [90m(D:\Coding\gymflow\server\[39mnode_modules\[4
m@prisma[24m\client\src\runtime\getPrismaClient.ts:805:24[90m)[3
9m {
  code: [32m'P2025'[39m,
  meta: { modelName: [32m'User'[39m, operation: [32m'an update'
[39m },
  clientVersion: [32m'7.1.0'[39m
}

[90m    at genericNodeError (node:internal/errors:983:15)[39m
[90m    at wrappedFn (node:internal/errors:537:14)[39m
[90m    at ChildProcess.exithandler (node:child_process:415:12)[3
9m
[90m    at ChildProcess.emit (node:events:518:28)[39m
[90m    at maybeClose (node:internal/child_process:1101:16)[39m
[90m    at Process.ChildProcess._handle.onexit (node:internal/chil
d_process:304:5)[39m
[90m    at Process.callbackTrampoline (node:internal/async_hooks:1
30:17)[39m {
  code: [33m1[39m,
  killed: [33mfalse[39m,
  signal: [1mnull[22m,
  cmd: [32m'npx ts-node promote_admin.ts test.user.yuinwb@example.
com'[39m,
  stdout: [32m'[Prisma] Initializing in TEST mode\n'[39m +
    [32m'Initializing Prisma Adapter with URL: file:./test.db\n'[
39m +
    [32m'Script CWD: D:\\Coding\\gymflow\\server\n'[39m +
    [32m'DATABASE_URL: file:./test.db\n'[39m +
    [32m'Looking for email: test.user.yuinwb@example.com\n'[39m +
    [32m'Total users in DB: \x1B[33m128\x1B[39m\n'[39m +
    [32m'User found check: NO\n'[39m,
  stderr: [32m'Error: PrismaClientKnownRequestError: \n'[39m +
    [32m'Invalid `prisma.user.update()` invocation in\n'[39m +
    [32m'D:\\Coding\\gymflow\\server\\promote_admin.ts:22:27\n'[3
9m +
    [32m'\n'[39m +
    [32m'  19 const found = await prisma.user.findUnique({ where: 
{ email } });\n'[39m +
    [32m"  20 console.log('User found check:', found ? 'YES' : 'NO
');\n"[39m +
    [32m'  21 \n'[39m +
    [32m'ΓåÆ 22 await prisma.user.update(\n'[39m +
    [32m'An operation failed because it depends on one or more rec
ords that were required but not found. No record was found for an u
pdate.\n'[39m +
    [32m'    at qr.handleRequestError \x1B[90m(D:\\Coding\\gymflow
\\server\\\x1B[39mnode_modules\\\x1B[4m@prisma\x1B[24m\\client\\src
\\runtime\\RequestHandler.ts:228:13\x1B[90m)\x1B[39m\n'[39m +
    [32m'    at qr.handleAndLogRequestError \x1B[90m(D:\\Coding\\g
ymflow\\server\\\x1B[39mnode_modules\\\x1B[4m@prisma\x1B[24m\\clien
t\\src\\runtime\\RequestHandler.ts:174:12\x1B[90m)\x1B[39m\n'[39m 
+
    [32m'    at qr.request \x1B[90m(D:\\Coding\\gymflow\\server\\\
x1B[39mnode_modules\\\x1B[4m@prisma\x1B[24m\\client\\src\\runtime\\
RequestHandler.ts:143:12\x1B[90m)\x1B[39m\n'[39m +
    [32m'\x1B[90m    at processTicksAndRejections (node:internal/p
rocess/task_queues:105:5)\x1B[39m\n'[39m +
    [32m'    at async a \x1B[90m(D:\\Coding\\gymflow\\server\\\x1B
[39mnode_modules\\\x1B[4m@prisma\x1B[24m\\client\\src\\runtime\\get
PrismaClient.ts:805:24\x1B[90m)\x1B[39m {\n'[39m +
    [32m"  code: \x1B[32m'P2025'\x1B[39m,\n"[39m +
    [32m"  meta: { modelName: \x1B[32m'User'\x1B[39m, operation: \
x1B[32m'an update'\x1B[39m },\n"[39m +
    [32m"  clientVersion: \x1B[32m'7.1.0'\x1B[39m\n"[39m +
    [32m'}\n'[39m

}
[1A[2KFailed CMD Stdout: [Prisma] Initializing in TEST mode
Initializing Prisma Adapter with URL: file:./test.db
Script CWD: D:\Coding\gymflow\server
DATABASE_URL: file:./test.db
Looking for email: test.user.yuinwb@example.com
Total users in DB: [33m128[39m
User found check: NO


[1A[2KFailed CMD Stderr: Error: PrismaClientKnownRequestError: 
Invalid `prisma.user.update()` invocation in
D:\Coding\gymflow\server\promote_admin.ts:22:27

  19 const found = await prisma.user.findUnique({ where: { email } 
});
  20 console.log('User found check:', found ? 'YES' : 'NO');
  21 
ΓåÆ 22 await prisma.user.update(
An operation failed because it depends on one or more records that 
were required but not found. No record was found for an update.

    at qr.handleRequestError [90m(D:\Coding\gymflow\server\[39mno
de_modules\[4m@prisma[24m\client\src\runtime\RequestHandler.ts:22
8:13[90m)[39m
    at qr.handleAndLogRequestError [90m(D:\Coding\gymflow\server\
[39mnode_modules\[4m@prisma[24m\client\src\runtime\RequestHandler
.ts:174:12[90m)[39m
    at qr.request [90m(D:\Coding\gymflow\server\[39mnode_modules\
[4m@prisma[24m\client\src\runtime\RequestHandler.ts:143:12[90m)
[39m
[90m    at processTicksAndRejections (node:internal/process/task_q
ueues:105:5)[39m
    at async a [90m(D:\Coding\gymflow\server\[39mnode_modules\[4
m@prisma[24m\client\src\runtime\getPrismaClient.ts:805:24[90m)[3
9m {
  code: [32m'P2025'[39m,
  meta: { modelName: [32m'User'[39m, operation: [32m'an update'
[39m },
  clientVersion: [32m'7.1.0'[39m
}

[1A[2K  1) [chromium] ΓÇ║ tests\user-system-management.spec.ts:253:5 ΓÇ║ V. User & System Management ΓÇ║ 5.7. B. Admin Panel - View User List 

    Error: Command failed: npx ts-node promote_admin.ts test.user.yuinwb@example.com
    Error: PrismaClientKnownRequestError: 
    Invalid `prisma.user.update()` invocation in
    D:\Coding\gymflow\server\promote_admin.ts:22:27

      19 const found = await prisma.user.findUnique({ where: { email } });
      20 console.log('User found check:', found ? 'YES' : 'NO');
      21 
    ΓåÆ 22 await prisma.user.update(
    An operation failed because it depends on one or more records that were required but not found. No record was found for an update.

       at ..\server\promote_admin.ts:22

      20 |         console.log('User found check:', found ? 'YES' : 'NO');
      21 |
    > 22 |         await prisma.user.update({
         |                           ^
      23 |             where: { email },
      24 |             data: {
      25 |                 role: 'ADMIN'
        at qr.handleRequestError [90m(D:\Coding\gymflow\server\[39mnode_modules\[4m@prisma[24m\client\src\runtime\RequestHandler.ts:228:13[90m)[39m
        at qr.handleAndLogRequestError [90m(D:\Coding\gymflow\server\[39mnode_modules\[4m@prisma[24m\client\src\runtime\RequestHandler.ts:174:12[90m)[39m
        at qr.request [90m(D:\Coding\gymflow\server\[39mnode_modules\[4m@prisma[24m\client\src\runtime\RequestHandler.ts:143:12[90m)[39m
    [90m    at processTicksAndRejections (node:internal/process/task_queues:105:5)[39m
        at async a [90m(D:\Coding\gymflow\server\[39mnode_modules\[4m@prisma[24m\client\src\runtime\getPrismaClient.ts:805:24[90m)[39m {
      code: [32m'P2025'[39m,
      meta: { modelName: [32m'User'[39m, operation: [32m'an update'[39m },
      clientVersion: [32m'7.1.0'[39m
    }

        at D:\Coding\gymflow\server\promote_admin.ts:22:27


[1A[2K  1 failed
    [chromium] ΓÇ║ tests\user-system-management.spec.ts:253:5 ΓÇ║ V. User & System Management ΓÇ║ 5.7. B. Admin Panel - View User List 
