mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
chore: Fixup tests snapshots to match new testid behaviour
- Move order-of-sidebar-items to the new package - Fix the extension sidebar item registrator Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
7924ab5504
commit
27aaa3623d
38 files changed
+1482
-16995
No files matched your search
@@ -9,14 +9,15 @@ import type { HotbarData } from "../common/hotbar";
|
||||
import type { HotbarItem } from "../common/types";
|
||||
import v640HotbarStoreMigrationInjectable from "./welcome-page-migration.injectable";
|
||||
import { defaultHotbarCells } from "../common/types";
|
||||
import { array } from "@k8slens/utilities";
|
||||
|
||||
function fillWithEmpties(items: HotbarItem[]) {
|
||||
const emptyHotBarItems = new Array(defaultHotbarCells).fill(null);
|
||||
function fillWithEmpties(items: (HotbarItem | null)[]) {
|
||||
const emptyHotBarItems = array.filled(defaultHotbarCells, null);
|
||||
|
||||
return [...items, ...emptyHotBarItems.slice(items.length)];
|
||||
}
|
||||
|
||||
function setFirstHotbarItems(store: MigrationStore, items: HotbarItem[]) {
|
||||
function setFirstHotbarItems(store: MigrationStore, items: (HotbarItem | null)[]) {
|
||||
const oldHotbars = store.get("hotbars") as HotbarData[];
|
||||
// empty hotbar items are nulls
|
||||
const itemsWithEmptyCells = fillWithEmpties(items);
|
||||
|
||||
Reference in new issue
Block a user