frontend/test/common/entity/compute_state_domain.test.ts

13 lines
353 B
TypeScript

import { assert, describe, it } from "vitest";
import { computeStateDomain } from "../../../src/common/entity/compute_state_domain";
describe("computeStateDomain", () => {
it("Detects sensor domain", () => {
const stateObj: any = {
entity_id: "sensor.test",
};
assert.strictEqual(computeStateDomain(stateObj), "sensor");
});
});