Fixing hotbar drag-n-drop animation issues (#2704)

This commit is contained in:
Alex Andreev authored and GitHub committed 2021-05-05 17:37:06 -04:00
1 parent 1044c544ad
commit 768e1d14ca
4 files changed
+62 -12

No files matched your search

+15
View File
@@ -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;