1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

fix unit tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-05-18 10:16:08 -04:00
parent dbf130d920
commit bebf8013c8

View File

@ -24,7 +24,6 @@ import { WebLink } from "../catalog-entities";
import { CatalogEntityRegistry } from "../catalog";
describe("CatalogEntityRegistry", () => {
let registry: CatalogEntityRegistry;
const entity = new WebLink({
metadata: {
uid: "test",
@ -41,11 +40,16 @@ describe("CatalogEntityRegistry", () => {
});
beforeEach(() => {
registry = new CatalogEntityRegistry();
CatalogEntityRegistry.createInstance();
});
afterEach(() => {
CatalogEntityRegistry.resetInstance();
});
describe("addSource", () => {
it ("allows to add an observable source", () => {
const registry = CatalogEntityRegistry.getInstance();
const source = observable.array([]);
registry.addObservableSource("test", source);
@ -57,6 +61,7 @@ describe("CatalogEntityRegistry", () => {
});
it ("added source change triggers reaction", (done) => {
const registry = CatalogEntityRegistry.getInstance();
const source = observable.array([]);
registry.addObservableSource("test", source);
@ -70,6 +75,7 @@ describe("CatalogEntityRegistry", () => {
describe("removeSource", () => {
it ("removes source", () => {
const registry = CatalogEntityRegistry.getInstance();
const source = observable.array([]);
registry.addObservableSource("test", source);