Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/achievement-estimators.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @vitest-environment node
import { describe, expect, it } from "vitest";
import {
calculateNextTier,
Expand All @@ -9,12 +10,11 @@ describe("calculateNextTier", () => {

it("returns the first tier when current is below all tiers", () => {
expect(calculateNextTier(0, tiers)).toBe(1);
expect(calculateNextTier(0, tiers)).toBe(1);
});

it("returns the next tier when current is below a tier", () => {
expect(calculateNextTier(5, tiers)).toBe(16);
expect(calculateNextTier(15, tiers)).toBe(128);
expect(calculateNextTier(15, tiers)).toBe(16); // 15 < 16, so next is 16
});

it("returns the next tier when current equals a tier", () => {
Expand All @@ -38,7 +38,7 @@ describe("calculateNextTier", () => {
});

describe("calculatePercentage", () => {
it("returns 0 when nextTier is null (maxed)", () => {
it("returns 100 when nextTier is null (maxed out)", () => {
expect(calculatePercentage(100, null)).toBe(100);
});

Expand All @@ -59,4 +59,4 @@ describe("calculatePercentage", () => {
it("handles 0 current gracefully", () => {
expect(calculatePercentage(0, 100)).toBe(0);
});
});
});
Loading