feat: Introduce TimerKey enum and refactor timer key usage across services with new tests.

This commit is contained in:
syntaxbullet
2026-02-13 13:11:16 +01:00
parent 570cdc69c1
commit 2d35a5eabb
5 changed files with 57 additions and 7 deletions

View File

@@ -0,0 +1,44 @@
import { describe, it, expect } from "bun:test";
import { TimerKey, TimerType, TransactionType } from "./constants";
describe("TimerKey", () => {
it("should have CHAT_XP value", () => {
expect(TimerKey.CHAT_XP).toBe("chat_xp" as TimerKey);
});
it("should have DAILY value", () => {
expect(TimerKey.DAILY).toBe("daily" as TimerKey);
});
it("should have WEEKLY value", () => {
expect(TimerKey.WEEKLY).toBe("weekly" as TimerKey);
});
});
describe("TimerType", () => {
it("should have COOLDOWN value", () => {
expect(TimerType.COOLDOWN).toBe("COOLDOWN" as TimerType);
});
it("should have EFFECT value", () => {
expect(TimerType.EFFECT).toBe("EFFECT" as TimerType);
});
it("should have ACCESS value", () => {
expect(TimerType.ACCESS).toBe("ACCESS" as TimerType);
});
});
describe("TransactionType", () => {
it("should have DAILY_REWARD value", () => {
expect(TransactionType.DAILY_REWARD).toBe("DAILY_REWARD" as TransactionType);
});
it("should have TRANSFER_IN value", () => {
expect(TransactionType.TRANSFER_IN).toBe("TRANSFER_IN" as TransactionType);
});
it("should have TRANSFER_OUT value", () => {
expect(TransactionType.TRANSFER_OUT).toBe("TRANSFER_OUT" as TransactionType);
});
});