diff --git a/src/modules/proposal/services/__tests__/proposal-contracting.service.spec.ts b/src/modules/proposal/services/__tests__/proposal-contracting.service.spec.ts index 9f47f46..48f703a 100644 --- a/src/modules/proposal/services/__tests__/proposal-contracting.service.spec.ts +++ b/src/modules/proposal/services/__tests__/proposal-contracting.service.spec.ts @@ -33,6 +33,7 @@ import { StatusChangeService } from '../status-change.service'; import { ForbiddenException, NotFoundException } from '@nestjs/common'; import { NoErrorThrownError, getError } from 'test/get-error'; import { InitContractingDto } from '../../dto/proposal/init-contracting.dto'; +import { ProposalUploadService } from '../proposal-upload.service'; jest.mock('class-transformer', () => { const original = jest.requireActual('class-transformer'); @@ -94,6 +95,7 @@ describe('ProposalContractingService', () => { let eventEngineService: jest.Mocked; let storageService: jest.Mocked; let statusChangeService: jest.Mocked; + let proposalUploadService: jest.Mocked; const request = { user: { @@ -161,6 +163,12 @@ describe('ProposalContractingService', () => { handleEffects: jest.fn(), }, }, + { + provide: ProposalUploadService, + useValue: { + handleEffects: jest.fn(), + }, + }, ], imports: [], }).compile(); @@ -170,6 +178,9 @@ describe('ProposalContractingService', () => { eventEngineService = module.get(EventEngineService) as jest.Mocked; storageService = module.get(StorageService) as jest.Mocked; statusChangeService = module.get(StatusChangeService) as jest.Mocked; + proposalUploadService = module.get( + ProposalUploadService, + ) as jest.Mocked; }); it('should be defined', () => { diff --git a/src/modules/proposal/services/proposal-contracting.service.ts b/src/modules/proposal/services/proposal-contracting.service.ts index d4f9de9..d6b69b3 100644 --- a/src/modules/proposal/services/proposal-contracting.service.ts +++ b/src/modules/proposal/services/proposal-contracting.service.ts @@ -1,7 +1,6 @@ import { ProposalUploadService } from './proposal-upload.service'; import { ForbiddenException, Injectable, NotFoundException } from '@nestjs/common'; import { plainToClass } from 'class-transformer'; -import { isNotEmptyObject } from 'class-validator'; import { Role } from 'src/shared/enums/role.enum'; import { IRequestUser } from 'src/shared/types/request-user.interface'; import { convertUserToGroups } from 'src/shared/utils/user-group.utils'; diff --git a/src/modules/proposal/utils/__tests__/handle-location-vote.util.spec.ts b/src/modules/proposal/utils/__tests__/handle-location-vote.util.spec.ts index 0888583..6551e8a 100644 --- a/src/modules/proposal/utils/__tests__/handle-location-vote.util.spec.ts +++ b/src/modules/proposal/utils/__tests__/handle-location-vote.util.spec.ts @@ -305,7 +305,7 @@ describe('addLocationVoteUtil', () => { expect(proposal.uacApprovals.length).toEqual(0); expect(proposal.uacApprovals).not.toEqual([uacApproval]); expect(clearLocationsVotes).toBeCalledWith(proposal, uacApproval.location); - expect(proposal.requestedButExcludedLocations).not.toEqual([request.user.miiLocation]); + expect(proposal.uacApprovedLocations).not.toEqual([request.user.miiLocation]); expect(proposal.openDizChecks).toEqual([uacApproval.location]); }); @@ -354,7 +354,7 @@ describe('addLocationVoteUtil', () => { expect(removeFdpgTask).toBeCalledWith(proposal, FdpgTaskType.DataAmountReached); } expect(clearLocationsVotes).toBeCalledWith(proposal, condition.location); - expect(proposal.requestedButExcludedLocations).not.toEqual([request.user.miiLocation]); + expect(proposal.uacApprovedLocations).not.toEqual([request.user.miiLocation]); expect(proposal.openDizChecks).toEqual([condition.location]); }); }); @@ -383,7 +383,7 @@ describe('addLocationVoteUtil', () => { expect(removeFdpgTask).toBeCalledWith(proposal, condition.fdpgTaskId); expect(proposal.conditionalApprovals).not.toEqual([condition]); expect(clearLocationsVotes).toBeCalledWith(proposal, condition.location); - expect(proposal.requestedButExcludedLocations).not.toEqual([request.user.miiLocation]); + expect(proposal.uacApprovedLocations).not.toEqual([request.user.miiLocation]); expect(proposal.openDizChecks).toEqual([condition.location]); }); @@ -406,7 +406,7 @@ describe('addLocationVoteUtil', () => { expect(proposalUploadServiceMock.deleteUpload).toBeCalledTimes(1); expect(proposalUploadServiceMock.deleteUpload).toBeCalledWith(proposal._id, condition.uploadId, request.user); expect(clearLocationsVotes).toBeCalledWith(proposal, condition.location); - expect(proposal.requestedButExcludedLocations).not.toEqual([request.user.miiLocation]); + expect(proposal.uacApprovedLocations).not.toEqual([request.user.miiLocation]); expect(proposal.openDizChecks).toEqual([condition.location]); }); });