UNPKG

@fakel/rest-admin

Version:

An application that makes it easier to work with your API

29 lines (28 loc) 968 B
import { ResourceStore } from "./../stores/ResorceStore"; describe("Resource Store", function () { var resourceStore; beforeAll(function () { resourceStore = new ResourceStore(); }); afterAll(function () { resourceStore.resources = []; }); test("should be push resource to array", function () { var resource = { name: "posts", }; resourceStore.pushResource(resource); var resources = resourceStore.resources; expect(resources).toHaveLength(1); }); test("getResource() should be return resource with specific name", function () { var name = "posts"; var resource = resourceStore.getResource(name); expect(resource.name).toBe(name); }); test("getResource() should be return undefiend", function () { var name = "tasks"; var resource = resourceStore.getResource(name); expect(resource).toBeUndefined(); }); });