mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Filter out unknown catalog entities (#2816)
* Filter out unknown catelog entities - Keep raw data - But filter unknown types until a category is registered Signed-off-by: Sebastian Malton <sebastian@malton.name> * fix unit tests Signed-off-by: Sebastian Malton <sebastian@malton.name> * simplify tests Signed-off-by: Sebastian Malton <sebastian@malton.name> * Remove getOrDefault, consolodate ExtendedMap Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
5ed4537979
commit
b61ba7ef71
4 files changed
+71
-49
No files matched your search
@@ -42,7 +42,7 @@ describe("CatalogEntityRegistry", () => {
|
||||
spec: {}
|
||||
}];
|
||||
|
||||
catalog.updateItems(items);
|
||||
(catalog as any).rawItems.replace(items);
|
||||
expect(catalog.items.length).toEqual(1);
|
||||
|
||||
items.push({
|
||||
@@ -60,7 +60,7 @@ describe("CatalogEntityRegistry", () => {
|
||||
spec: {}
|
||||
});
|
||||
|
||||
catalog.updateItems(items);
|
||||
(catalog as any).rawItems.replace(items);
|
||||
expect(catalog.items.length).toEqual(2);
|
||||
});
|
||||
|
||||
@@ -81,13 +81,13 @@ describe("CatalogEntityRegistry", () => {
|
||||
spec: {}
|
||||
}];
|
||||
|
||||
catalog.updateItems(items);
|
||||
(catalog as any).rawItems.replace(items);
|
||||
expect(catalog.items.length).toEqual(1);
|
||||
expect(catalog.items[0].status.phase).toEqual("disconnected");
|
||||
|
||||
items[0].status.phase = "connected";
|
||||
|
||||
catalog.updateItems(items);
|
||||
(catalog as any).rawItems.replace(items);
|
||||
expect(catalog.items.length).toEqual(1);
|
||||
expect(catalog.items[0].status.phase).toEqual("connected");
|
||||
});
|
||||
@@ -125,9 +125,9 @@ describe("CatalogEntityRegistry", () => {
|
||||
}
|
||||
];
|
||||
|
||||
catalog.updateItems(items);
|
||||
(catalog as any).rawItems.replace(items);
|
||||
items.splice(0, 1);
|
||||
catalog.updateItems(items);
|
||||
(catalog as any).rawItems.replace(items);
|
||||
expect(catalog.items.length).toEqual(1);
|
||||
expect(catalog.items[0].metadata.uid).toEqual("456");
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user