Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions nexus/backend/src/accounting/services/ledger.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { PrismaService } from '../../prisma/prisma.service';
import { BadRequestException } from '@nestjs/common';
import { Decimal } from '@prisma/client/runtime/library';
import { TraceService } from '../../common/services/trace.service';
import { BillingService } from '../../system/services/billing.service';

describe('LedgerService (Financial Integrity)', () => {
let service: LedgerService;
Expand Down Expand Up @@ -39,6 +40,13 @@ describe('LedgerService (Financial Integrity)', () => {
LedgerService,
{ provide: PrismaService, useValue: mockPrisma },
{ provide: TraceService, useValue: mockTrace },
{
provide: BillingService,
useValue: {
getPlanByTenant: jest.fn().mockResolvedValue('Enterprise'),
checkQuota: jest.fn().mockResolvedValue(undefined),
},
},
{ provide: 'CACHE_MANAGER', useValue: { get: jest.fn(), set: jest.fn() } },
],
}).compile();
Expand Down
4 changes: 2 additions & 2 deletions nexus/backend/src/app.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ describe('AppController', () => {
});

describe('root', () => {
it('should return "Hello World!"', () => {
expect(appController.getHello()).toBe('Nexus ERP Engine v2.0 is Online 🟢');
it('should return operational status message', () => {
expect(appController.getHello()).toBe('Nexus ERP API Gateway is Operational');
});
});
});
7 changes: 7 additions & 0 deletions nexus/backend/src/system/services/audit-collab-001.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { CollaborationService } from './collaboration.service';
import { PrismaService } from '../../prisma/prisma.service';
import { AuditService } from './audit.service';
import { NotFoundException } from '@nestjs/common';
import { CollaborationGateway } from '../gateways/collaboration.gateway';

describe('CollaborationService: TEN-001 Audit', () => {
let service: CollaborationService;
Expand All @@ -20,12 +21,18 @@ describe('CollaborationService: TEN-001 Audit', () => {
log: jest.fn(),
};

const mockGateway = {
broadcastCommentAdded: jest.fn(),
broadcastCommentDeleted: jest.fn(),
};

beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [
CollaborationService,
{ provide: PrismaService, useValue: mockPrisma },
{ provide: AuditService, useValue: mockAudit },
{ provide: CollaborationGateway, useValue: mockGateway },
],
}).compile();

Expand Down