Skip to content

Commit

Permalink
fix:fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
divinecharlotte committed Dec 9, 2024
1 parent 07be4a2 commit 57afd2c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apps/drec-api/src/pods/device/device.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ export class DeviceService {
delete result['organization'];
return result;
}
public async newfindForGroup(
public async newFindForGroup(
groupId: number,
): Promise<{ [key: string]: Device[] }> {
this.logger.verbose(`With in NewfindForGroup`);
Expand Down
14 changes: 7 additions & 7 deletions apps/drec-api/src/pods/issuer/issuer.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ describe('IssuerService', () => {
getAllNextrequestCertificate: jest.fn(),
findOne: jest.fn(),
EndReservationGroup: jest.fn(),
updatecertificateissuedate: jest.fn(),
updateCertificateIssueDate: jest.fn(),
getNextHistoryissuanceDevicelog: jest.fn(),
AddCertificateIssueDateLogForDeviceGroup: jest.fn(),
addCertificateIssueDateLogForDeviceGroup: jest.fn(),
updateHistoryCertificateIssueDate: jest.fn(),
updateTotalReadingRequestedForCertificateIssuance: jest.fn(),
countGroupIdHistoryIssuanceDeviceLog: jest.fn(),
Expand All @@ -75,7 +75,7 @@ describe('IssuerService', () => {
{
provide: DeviceService,
useValue: {
NewfindForGroup: jest.fn(),
newFindForGroup: jest.fn(),
findForGroup: jest.fn(),
findReads: jest.fn(),
addCertificateIssueDateLogForDevice: jest.fn(),
Expand Down Expand Up @@ -196,8 +196,8 @@ describe('IssuerService', () => {
const updatecertificateissuedateSpy = jest
.spyOn(groupService, 'updateCertificateIssueDate')
.mockResolvedValue(undefined);
const NewfindForGroupSpy = jest
.spyOn(deviceService, 'newfindForGroup')
const NewFindForGroupSpy = jest
.spyOn(deviceService, 'newFindForGroup')
.mockImplementation(() => Promise.resolve({}));
const orgfindOneSpy = jest
.spyOn(organizationService, 'findOne')
Expand All @@ -216,7 +216,7 @@ describe('IssuerService', () => {
expect(getAllNextrequestCertificateSpy).toHaveBeenCalled();
expect(findOneSpy).toHaveBeenCalledWith({ id: mockGroupRequest.groupId });
expect(updatecertificateissuedateSpy).toHaveBeenCalled();
expect(NewfindForGroupSpy).toHaveBeenCalledWith(mockGroup.id);
expect(NewFindForGroupSpy).toHaveBeenCalledWith(mockGroup.id);
expect(orgfindOneSpy).toHaveBeenCalledWith(mockGroup.organizationId);
expect(findForGroupSpy).toHaveBeenCalledWith(mockGroup.id);
});
Expand Down Expand Up @@ -1194,7 +1194,7 @@ describe('IssuerService', () => {
name: 'OrgName',
blockchainAccountAddress: 'Address',
} as unknown as Organization);
jest.spyOn(deviceService, 'newfindForGroup').mockResolvedValue({});
jest.spyOn(deviceService, 'newFindForGroup').mockResolvedValue({});
jest
.spyOn(groupService, 'getGroupiCertificateIssueDate')
.mockResolvedValue({} as unknown as DeviceGroupNextIssueCertificate);
Expand Down
2 changes: 1 addition & 1 deletion apps/drec-api/src/pods/issuer/issuer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class IssuerService {
);
}

const countryDeviceGroup = await this.deviceService.newfindForGroup(
const countryDeviceGroup = await this.deviceService.newFindForGroup(
group.id,
);

Expand Down

0 comments on commit 57afd2c

Please sign in to comment.