import { describe, expect, it } from "vitest";
import { robotLocationLabel } from "@/features/rooms/hooks/useRobotRoomsPage.js";

describe("robotLocationLabel", () => {
    it("shows robot country and region labels", () => {
        const label = robotLocationLabel(
            {
                user: {
                    countryCode: "ae",
                    visibleRegionId: 686,
                },
            },
            { AE: "🇦🇪 · 阿联酋 · AE" },
            { 686: "中东 · ME · 686" },
        );

        expect(label).toBe("🇦🇪 · 阿联酋 · AE / 中东 · ME · 686");
    });

    it("falls back to raw country and region ids", () => {
        const label = robotLocationLabel({ user: { countryCode: "sa", visibleRegionId: 7 } }, {}, {});

        expect(label).toBe("SA / 区域 7");
    });
});
