0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 09:50:43 -05:00

Fixed two getHighestRelativeBotLevel() tests caused by a refactor of the functions parameters

This commit is contained in:
Dev 2024-05-13 22:41:34 +01:00
parent 5ec6bc1aae
commit 5254e9753e

View File

@ -52,10 +52,19 @@ describe("BotLevelGenerator", () =>
it("should return 10 when player level is 5 and delta is 5", () =>
{
const levelDetails: MinMax = { min: 5, max: 10 };
const botGenDetails: BotGenerationDetails = {
isPmc: false,
role: "",
side: "",
botRelativeLevelDeltaMax: 5,
botRelativeLevelDeltaMin: 5,
playerLevel: 5,
botCountToGenerate: 0,
botDifficulty: "",
isPlayerScav: false
};
const expTable = databaseServer.getTables().globals.config.exp.level.exp_table;
const result = botLevelGenerator.getHighestRelativeBotLevel(5, 5, levelDetails, expTable);
const result = botLevelGenerator.getHighestRelativeBotLevel(botGenDetails, levelDetails, 79);
expect(result).toBe(10);
});
@ -63,16 +72,22 @@ describe("BotLevelGenerator", () =>
it("should return 79 when player level is above possible max (100), desired max is 100 and delta is 5", () =>
{
const levelDetails: MinMax = { min: 100, max: 100 };
const expTable = databaseServer.getTables().globals.config.exp.level.exp_table;
const playerLevel = 100;
const relativeDeltaMax = 5;
const botGenDetails: BotGenerationDetails = {
isPmc: false,
role: "",
side: "",
botRelativeLevelDeltaMax: 5,
botRelativeLevelDeltaMin: 5,
playerLevel: 100,
botCountToGenerate: 0,
botDifficulty: "",
isPlayerScav: false
};
const result = botLevelGenerator.getHighestRelativeBotLevel(
playerLevel,
relativeDeltaMax,
botGenDetails,
levelDetails,
expTable,
79
);
expect(result).toBe(79);