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:
@@ -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");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user