diff --git a/project/tests/controllers/InsuranceController.test.ts b/project/tests/controllers/InsuranceController.test.ts index 78cd2be2..2627b4ad 100644 --- a/project/tests/controllers/InsuranceController.test.ts +++ b/project/tests/controllers/InsuranceController.test.ts @@ -188,6 +188,7 @@ describe("InsuranceController", () => vi.spyOn(insuranceController.itemHelper, "adoptOrphanedItems").mockImplementation(vi.fn()); vi.spyOn(insuranceController, "sendMail").mockImplementation(vi.fn()); vi.spyOn(insuranceController, "removeInsurancePackageFromProfile").mockImplementation(vi.fn()); + vi.spyOn(insuranceController.insuranceService.saveServer, "getProfile").mockImplementation(vi.fn()); // Execute the method. insuranceController.processInsuredItems(insuranceFixture, sessionId); @@ -217,6 +218,8 @@ describe("InsuranceController", () => "removeInsurancePackageFromProfile", ).mockImplementation(vi.fn()); + vi.spyOn(insuranceController.insuranceService.saveServer, "getProfile").mockReturnValue({}); + // Execute the method. insuranceController.processInsuredItems(insuranceFixture, sessionId); @@ -1231,7 +1234,7 @@ describe("InsuranceController", () => const result = insuranceController.rollForDelete(traderId); // Verify that the result is null. - expect(result).toBe(null); + expect(result).toBe(undefined); }); }); diff --git a/project/tests/generators/BotGenerator.test.ts b/project/tests/generators/BotGenerator.test.ts index e33d0327..6ef378da 100644 --- a/project/tests/generators/BotGenerator.test.ts +++ b/project/tests/generators/BotGenerator.test.ts @@ -197,8 +197,8 @@ describe("BotGenerator", () => const botRole = "assault"; botGenerator.botConfig.chanceAssaultScavHasPlayerScavName = 100; - botGenerator.databaseServer.getTables().bots.types.usec.firstName = ["player"]; - botGenerator.databaseServer.getTables().bots.types.bear.firstName = []; + botGenerator.databaseService.getBots().types.usec.firstName = ["player"]; + botGenerator.databaseService.getBots().types.bear.firstName = []; const mockPlayerProfile = { Info: { Nickname: "Player", Level: 1 } }; vi.spyOn(botGenerator.profileHelper, "getPmcProfile").mockReturnValue(mockPlayerProfile); diff --git a/project/tests/helpers/ItemHelper.test.ts b/project/tests/helpers/ItemHelper.test.ts index 6a500bdb..1becb91e 100644 --- a/project/tests/helpers/ItemHelper.test.ts +++ b/project/tests/helpers/ItemHelper.test.ts @@ -1040,14 +1040,14 @@ describe("ItemHelper", () => const fakeTemplateItem = { _props: { Cartridges: [{}] } }; const result = itemHelper.getRandomCompatibleCaliberTemplateId(fakeTemplateItem as ITemplateItem); - expect(result).toBe(null); + expect(result).toBe(undefined); }); it("should return null when undefined passed in", () => { const result = itemHelper.getRandomCompatibleCaliberTemplateId(undefined as ITemplateItem); - expect(result).toBe(null); + expect(result).toBe(undefined); }); it("should log a warning when the template cartridge can not be found", () => diff --git a/project/tests/services/ProfileFixerService.test.ts b/project/tests/services/ProfileFixerService.test.ts index c5f0003e..e4e8352d 100644 --- a/project/tests/services/ProfileFixerService.test.ts +++ b/project/tests/services/ProfileFixerService.test.ts @@ -18,16 +18,16 @@ describe("ProfileFixerService", () => describe("FixPmcProfileIssues", () => { - it("should reset nextResupply to 0 when it is null", () => + it("should reset nextResupply to 0 when it is undefined", () => { - const pmcProfile = { TradersInfo: { traderId: { nextResupply: null } } }; + const pmcProfile = { TradersInfo: { traderId: { nextResupply: undefined } } }; profileFixerService.fixNullTraderNextResupply(pmcProfile); expect(pmcProfile.TradersInfo.traderId.nextResupply).toBe(0); }); - it("should not reset nextResupply to 0 when it is not null", () => + it("should not reset nextResupply to 0 when it is not undefined", () => { const pmcProfile = { TradersInfo: { traderId: { nextResupply: 1234 } } };