
> @workspace/http-backend@1.0.0 test E:\bms-monorepo\apps\http-backend
> jest --forceExit "tests/unit/modules/owner-identity/application/use-cases/submit-owner-identity.usecase.test.ts"

node.exe : FAIL tests/unit/modules/owner-identity/application/use-cases/submit-owner-identity.usecase.test.ts
At C:\Users\saavi\AppData\Roaming\npm\pnpm.ps1:24 char:5
+     & "node$exe"  "$basedir/node_modules/pnpm/bin/pnpm.cjs" $args
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (FAIL tests/unit...usecase.test.ts:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
  SubmitOwnerIdentityUseCase
    Registration & Idempotency
      G should return cached response if idempotency key exists and is completed (8 ms)
      G should create a new idempotency record if it does not exist (6 ms)
    Happy Path
      + should successfully submit owner identity and commit transaction (8 ms)
      G should set state to POTENTIAL_DUPLICATE if geo-check finds conflicts (3 ms)
    Validation & Error Handling
      G should throw DraftNotFoundError if no draft exists for account (9 ms)
      G should throw DraftIncompleteError if validation fails (3 ms)
      G should handle P2002 unique constraint violations as DuplicateBusinessInfoError (3 ms)
      G should track unexpected database errors as db_error (3 ms)

  G SubmitOwnerIdentityUseCase GǦ Happy Path GǦ should successfully submit owner identity and commit transaction

    expect(jest.fn()).toHaveBeenCalledWith(...expected)

    Expected: ObjectContaining {"accountId": "acc-123"}
    Received: {"data": {"accountId": "acc-123", "assignedRole": "OWNER", "ownerIdentityId": "identity-123"}}

    Number of calls: 1

    [0m [90m 163 |[39m         })
     [90m 164 |[39m       }))[33m;[39m
    [31m[1m>[22m[39m[90m 165 |[39m       expect(mockPrisma[33m.[39mownerAccountRelation[33m.[39mcreate)[33m.
[39mtoHaveBeenCalledWith(expect[33m.[39mobjectContaining({ accountId[33m:[39m mockAccountId }))[33m;[39m
     [90m     |[39m                                                      [31m[1m^[22m[39m
     [90m 166 |[39m       expect(mockPrisma[33m.[39mownerDraft[33m.[39mupdate)[33m.[39mtoHaveBeenCalledWith(exp
ect[33m.[39mobjectContaining({ where[33m:[39m { id[33m:[39m mockDraft[33m.[39mid } }))[33m;[39m
     [90m 167 |[39m       expect(mockEventPublisher[33m.[39mpublish)[33m.[39mtoHaveBeenCalled()[33m;[39m
     [90m 168 |[39m       [0m

      at Object.<anonymous> 
(tests/unit/modules/owner-identity/application/use-cases/submit-owner-identity.usecase.test.ts:165:54)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 7 passed, 8 total
Snapshots:   0 total
Time:        1.088 s
Ran all test suites matching 
/tests\\unit\\modules\\owner-identity\\application\\use-cases\\submit-owner-identity.usecase.test.ts/i.
Force exiting Jest: Have you considered using `--detectOpenHandles` to detect async operations that kept running after 
all tests finished?
GELIFECYCLEG Test failed. See above for more details.
