Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

766 B
Raw Blame
import { describe, expect, it } from "vitest";

import { getUpsDevices } from "./component";

describe("UPS source ownership", () => {
  it("uses integration-scoped keys for overlapping device ids", () => {
    const devices = getUpsDevices([
      {
        integrationId: "ups-a",
        integrationName: "UPS A",
        summaries: [{ id: "same", status: "online" as const }],
      },
      {
        integrationId: "ups-b",
        integrationName: "UPS B",
        summaries: [{ id: "same", status: "online" as const }],
      },
    ]);

    expect(devices.map(({ key, integrationName }) => ({ key, integrationName }))).toEqual([
      { key: "ups-a:same", integrationName: "UPS A" },
      { key: "ups-b:same", integrationName: "UPS B" },
    ]);
  });
});