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;