1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-04-18 16:07:40 +01:00

Add formatEntityName helper on hass object. (#26057)

This commit is contained in:
Paul Bottein
2025-09-15 16:18:52 +02:00
committed by GitHub
parent 9d02a1d391
commit af31b5add3
23 changed files with 285 additions and 149 deletions

View File

@@ -26,7 +26,13 @@ describe("getEntityContext", () => {
floors: {},
} as unknown as HomeAssistant;
const result = getEntityContext(stateObj, hass);
const result = getEntityContext(
stateObj,
hass.entities,
hass.devices,
hass.areas,
hass.floors
);
expect(result).toEqual({
entity,
@@ -71,7 +77,13 @@ describe("getEntityContext", () => {
},
} as unknown as HomeAssistant;
const result = getEntityContext(stateObj, hass);
const result = getEntityContext(
stateObj,
hass.entities,
hass.devices,
hass.areas,
hass.floors
);
expect(result).toEqual({
entity,
@@ -105,7 +117,13 @@ describe("getEntityContext", () => {
},
} as unknown as HomeAssistant;
const result = getEntityContext(stateObj, hass);
const result = getEntityContext(
stateObj,
hass.entities,
hass.devices,
hass.areas,
hass.floors
);
expect(result).toEqual({
entity,
@@ -138,7 +156,13 @@ describe("getEntityContext", () => {
floors: {},
} as unknown as HomeAssistant;
const result = getEntityContext(stateObj, hass);
const result = getEntityContext(
stateObj,
hass.entities,
hass.devices,
hass.areas,
hass.floors
);
expect(result).toEqual({
entity,