mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add more test cases
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
f6bfd7d304
commit
5cc9f677c8
@ -57,6 +57,18 @@ describe("update-entity-spec", () => {
|
|||||||
expect(entity.spec.icon?.src).toEqual("data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/");
|
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", () => {
|
it("given cluster icon is null, deletes icon from both", () => {
|
||||||
cluster.preferences.icon = null;
|
cluster.preferences.icon = null;
|
||||||
entity.spec.icon = { src : "some-icon" };
|
entity.spec.icon = { src : "some-icon" };
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user