From 5cc9f677c8cf5fe6b30839345fafcdb8932c81a7 Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Thu, 16 Mar 2023 17:51:50 +0300 Subject: [PATCH] Add more test cases Signed-off-by: Alex Andreev --- .../core/src/main/cluster/update-entity-spec.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/core/src/main/cluster/update-entity-spec.test.ts b/packages/core/src/main/cluster/update-entity-spec.test.ts index 95a481d84a..a21e1fae46 100644 --- a/packages/core/src/main/cluster/update-entity-spec.test.ts +++ b/packages/core/src/main/cluster/update-entity-spec.test.ts @@ -57,6 +57,18 @@ describe("update-entity-spec", () => { expect(entity.spec.icon?.src).toEqual("data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/"); }); + it("given cluster has custom icon background color set, updates entity spec with icon", () => { + cluster.preferences.icon = "#ff0000"; + updateEntitySpec(entity, cluster); + expect(entity.spec.icon?.background).toEqual("#ff0000"); + }); + + it("given cluster has custom icon background color set, does not update entity icon src", () => { + cluster.preferences.icon = "#ff0000"; + updateEntitySpec(entity, cluster); + expect(entity.spec.icon?.src).toBeUndefined(); + }); + it("given cluster icon is null, deletes icon from both", () => { cluster.preferences.icon = null; entity.spec.icon = { src : "some-icon" };