Files
EpicNext-Cms/src/lib/habbo-gamedata-hotel.test.ts
T
SimoandCursor d1baaf798a
Local Build and Deploy / deploy (push) Failing after 33s
Add multi-hotel Habbo gamedata locale in CMS settings.
Furni name suggestions, import enrichment, and badge texts now follow habbo_gamedata_hotel instead of hardcoded habbo.it.

Co-authored-by: Cursor <[email protected]>
2026-07-17 22:28:18 +02:00

31 lines
959 B
TypeScript

import { describe, expect, it } from "vitest";
import {
habboExternalTextsUrl,
habboFurnidataUrl,
habboGamedataHotelShort,
normalizeHabboGamedataHotel,
} from "./habbo-gamedata-hotel";
describe("habbo-gamedata-hotel", () => {
it("normalizes known hotels and falls back to it", () => {
expect(normalizeHabboGamedataHotel("ES")).toBe("es");
expect(normalizeHabboGamedataHotel("com.br")).toBe("com.br");
expect(normalizeHabboGamedataHotel("nope")).toBe("it");
expect(normalizeHabboGamedataHotel(null)).toBe("it");
});
it("builds official gamedata URLs", () => {
expect(habboFurnidataUrl("de")).toBe(
"https://www.habbo.de/gamedata/furnidata_json/1",
);
expect(habboExternalTextsUrl("com.br")).toBe(
"https://www.habbo.com.br/gamedata/external_flash_texts/1",
);
});
it("formats short hotel labels", () => {
expect(habboGamedataHotelShort("it")).toBe("IT");
expect(habboGamedataHotelShort("com.br")).toBe("COM.BR");
});
});