feat: Introduce TimerKey enum and refactor timer key usage across services with new tests.
Some checks failed
Deploy to Production / test (push) Failing after 27s
Some checks failed
Deploy to Production / test (push) Failing after 27s
This commit is contained in:
44
shared/lib/constants.test.ts
Normal file
44
shared/lib/constants.test.ts
Normal 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);
|
||||
});
|
||||
});
|
||||
@@ -10,6 +10,12 @@ export enum TimerType {
|
||||
TRIVIA_COOLDOWN = 'TRIVIA_COOLDOWN',
|
||||
}
|
||||
|
||||
export enum TimerKey {
|
||||
CHAT_XP = 'chat_xp',
|
||||
DAILY = 'daily',
|
||||
WEEKLY = 'weekly',
|
||||
}
|
||||
|
||||
export enum EffectType {
|
||||
ADD_XP = 'ADD_XP',
|
||||
ADD_BALANCE = 'ADD_BALANCE',
|
||||
|
||||
Reference in New Issue
Block a user