Add more test cases

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2023-03-16 17:51:50 +03:00
1 parent f6bfd7d304
commit 5cc9f677c8
1 file changed
+12
@@ -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" };