sendou.ink/app/features/comp-analyzer/core/weapon-range.test.ts
Kalle 009a6943d5
Some checks are pending
E2E Tests / e2e (push) Waiting to run
Tests and checks on push / run-checks-and-tests (push) Waiting to run
Updates translation progress / update-translation-progress-issue (push) Waiting to run
Add comp analyzer range comparison test
2026-04-05 12:21:06 +03:00

23 lines
833 B
TypeScript

import { describe, expect, test } from "vitest";
import type { MainWeaponId } from "~/modules/in-game-lists/types";
import { getWeaponsWithRange } from "./weapon-range";
// [longerRangeWeaponId, shorterRangeWeaponId]
const RANGE_COMPARISONS: [MainWeaponId, MainWeaponId][] = [
[220, 210], // Range Blaster > Blaster
[70, 40], // Splattershot Pro > Splattershot
// [2020, 7030], // Splatterscope > Wellstring V TODO: a failing case
// [2070, 7010], // Snipewriter 5H > Tri-Stringer TODO: a failing case
];
describe("weapon range comparisons", () => {
test.each(
RANGE_COMPARISONS,
)("weapon %i has more range than weapon %i", (longerId, shorterId) => {
const [longer] = getWeaponsWithRange([longerId]);
const [shorter] = getWeaponsWithRange([shorterId]);
expect(longer.range).toBeGreaterThan(shorter.range);
});
});