FAIL src/modules/document-numbering/document-numbering.service.spec.ts
  DocumentNumberingService
    ΓêÜ should be defined (15 ms)
    generateNextNumber
      ΓêÜ should generate a new number successfully (4 ms)
      ΓêÜ should throw error when increment fails (9 ms)
    Admin Operations
      ├ù voidAndReplace should verify audit log exists (2 ms)
      ├ù cancelNumber should log cancellation (3 ms)

  ΓùÅ DocumentNumberingService ΓÇ║ Admin Operations ΓÇ║ voidAndReplace should verify audit log exists

    TypeError: Cannot read properties of undefined (reading 'mockResolvedValue')

      143 |     it('voidAndReplace should verify audit log exists', async () => {
      144 |       const auditRepo = module.get(getRepositoryToken(DocumentNumberAudit));
    > 145 |       (auditRepo.findOne as jest.Mock).mockResolvedValue({
          |                                        ^
      146 |         generatedNumber: 'DOC-001',
      147 |         counterKey: JSON.stringify({ projectId: 1, correspondenceTypeId: 1 }),
      148 |         templateUsed: 'test',

      at Object.<anonymous> (modules/document-numbering/document-numbering.service.spec.ts:145:40)

  ΓùÅ DocumentNumberingService ΓÇ║ Admin Operations ΓÇ║ cancelNumber should log cancellation

    TypeError: Cannot read properties of undefined (reading 'mockResolvedValue')

      161 |     it('cancelNumber should log cancellation', async () => {
      162 |       const auditRepo = module.get(getRepositoryToken(DocumentNumberAudit));
    > 163 |       (auditRepo.findOne as jest.Mock).mockResolvedValue({
          |                                        ^
      164 |         generatedNumber: 'DOC-002',
      165 |         counterKey: {},
      166 |       });

      at Object.<anonymous> (modules/document-numbering/document-numbering.service.spec.ts:163:40)

Test Suites: 1 failed, 1 total
Tests:       2 failed, 3 passed, 5 total
Snapshots:   0 total
Time:        1.381 s, estimated 2 s
Ran all test suites matching src/modules/document-numbering/document-numbering.service.spec.ts.
