From 70fe7be1a0ed1cb1424052d85c397d8f45b6b701 Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Tue, 4 May 2021 12:35:53 +0300 Subject: [PATCH] Adding one more test case Signed-off-by: Alex Andreev --- src/common/__tests__/hotbar-store.test.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/common/__tests__/hotbar-store.test.ts b/src/common/__tests__/hotbar-store.test.ts index 8e4748e515..9a15e9eb67 100644 --- a/src/common/__tests__/hotbar-store.test.ts +++ b/src/common/__tests__/hotbar-store.test.ts @@ -207,6 +207,21 @@ describe("HotbarStore", () => { expect(hotbarStore.getActive().items[0].entity.uid).toEqual("test"); }); + it("new items takes first empty cell", () => { + const hotbarStore = HotbarStore.createInstance(); + const test = new CatalogEntityItem(testCluster); + const minikube = new CatalogEntityItem(minikubeCluster); + const aws = new CatalogEntityItem(awsCluster); + + hotbarStore.load(); + hotbarStore.addToHotbar(test); + hotbarStore.addToHotbar(aws); + hotbarStore.restackItems(0, 3); + hotbarStore.addToHotbar(minikube); + + expect(hotbarStore.getActive().items[0].entity.uid).toEqual("minikube"); + }); + it("throws if invalid arguments provided", () => { // Prevent writing to stderr during this render. const err = console.error;