1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-04-19 00:12:51 +01:00

Revert entity naming change (#30384)

This commit is contained in:
Paul Bottein
2026-03-27 21:45:54 +01:00
committed by GitHub
parent 61724a52ba
commit 2bd8a657b8
19 changed files with 317 additions and 118 deletions

View File

@@ -115,6 +115,7 @@ describe("computeEntityNameDisplay", () => {
entities: {
"light.kitchen": mockEntity({
entity_id: "light.kitchen",
name: "Kitchen Device",
device_id: "dev1",
}),
},
@@ -140,12 +141,13 @@ describe("computeEntityNameDisplay", () => {
expect(result).toBe("Kitchen Device");
});
it("does not duplicate device name when entity uses device name and device is included", () => {
it("does not replace entity with device when device is already included", () => {
const stateObj = mockStateObj({ entity_id: "light.kitchen" });
const hass = {
entities: {
"light.kitchen": mockEntity({
entity_id: "light.kitchen",
name: "Kitchen Device",
device_id: "dev1",
}),
},
@@ -168,8 +170,8 @@ describe("computeEntityNameDisplay", () => {
hass.floors
);
// Entity has no name (uses device name), device is already included
// So we only get the device name once
// Since entity name equals device name, entity returns undefined
// So we only get the device name
expect(result).toBe("Kitchen Device");
});