mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
1 parent
dbf130d920
commit
bebf8013c8
1 file changed
+8
-2
@@ -24,7 +24,6 @@ import { WebLink } from "../catalog-entities";
|
|||||||
import { CatalogEntityRegistry } from "../catalog";
|
import { CatalogEntityRegistry } from "../catalog";
|
||||||
|
|
||||||
describe("CatalogEntityRegistry", () => {
|
describe("CatalogEntityRegistry", () => {
|
||||||
let registry: CatalogEntityRegistry;
|
|
||||||
const entity = new WebLink({
|
const entity = new WebLink({
|
||||||
metadata: {
|
metadata: {
|
||||||
uid: "test",
|
uid: "test",
|
||||||
@@ -41,11 +40,16 @@ describe("CatalogEntityRegistry", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
registry = new CatalogEntityRegistry();
|
CatalogEntityRegistry.createInstance();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
CatalogEntityRegistry.resetInstance();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("addSource", () => {
|
describe("addSource", () => {
|
||||||
it ("allows to add an observable source", () => {
|
it ("allows to add an observable source", () => {
|
||||||
|
const registry = CatalogEntityRegistry.getInstance();
|
||||||
const source = observable.array([]);
|
const source = observable.array([]);
|
||||||
|
|
||||||
registry.addObservableSource("test", source);
|
registry.addObservableSource("test", source);
|
||||||
@@ -57,6 +61,7 @@ describe("CatalogEntityRegistry", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it ("added source change triggers reaction", (done) => {
|
it ("added source change triggers reaction", (done) => {
|
||||||
|
const registry = CatalogEntityRegistry.getInstance();
|
||||||
const source = observable.array([]);
|
const source = observable.array([]);
|
||||||
|
|
||||||
registry.addObservableSource("test", source);
|
registry.addObservableSource("test", source);
|
||||||
@@ -70,6 +75,7 @@ describe("CatalogEntityRegistry", () => {
|
|||||||
|
|
||||||
describe("removeSource", () => {
|
describe("removeSource", () => {
|
||||||
it ("removes source", () => {
|
it ("removes source", () => {
|
||||||
|
const registry = CatalogEntityRegistry.getInstance();
|
||||||
const source = observable.array([]);
|
const source = observable.array([]);
|
||||||
|
|
||||||
registry.addObservableSource("test", source);
|
registry.addObservableSource("test", source);
|
||||||
|
|||||||
Reference in new issue
Block a user