mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 05:07:52 +00:00
Move tests to their own describe block (#3447)
This commit is contained in:
parent
f3d593bc1e
commit
c756adad6f
@ -30,11 +30,9 @@ describe("The Object API", () => {
|
||||
beforeEach(() => {
|
||||
mockProvider = jasmine.createSpyObj("mock provider", [
|
||||
"create",
|
||||
"update",
|
||||
"get"
|
||||
"update"
|
||||
]);
|
||||
mockProvider.create.and.returnValue(Promise.resolve(true));
|
||||
mockProvider.get.and.returnValue(Promise.resolve(mockDomainObject));
|
||||
objectAPI.addProvider(TEST_NAMESPACE, mockProvider);
|
||||
});
|
||||
it("Calls 'create' on provider if object is new", () => {
|
||||
@ -59,6 +57,19 @@ describe("The Object API", () => {
|
||||
expect(mockProvider.create).not.toHaveBeenCalled();
|
||||
expect(mockProvider.update).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("The get function", () => {
|
||||
describe("when a provider is available", () => {
|
||||
let mockProvider;
|
||||
beforeEach(() => {
|
||||
mockProvider = jasmine.createSpyObj("mock provider", [
|
||||
"get"
|
||||
]);
|
||||
mockProvider.get.and.returnValue(Promise.resolve(mockDomainObject));
|
||||
objectAPI.addProvider(TEST_NAMESPACE, mockProvider);
|
||||
});
|
||||
|
||||
it("Caches multiple requests for the same object", () => {
|
||||
expect(mockProvider.get.calls.count()).toBe(0);
|
||||
|
Loading…
Reference in New Issue
Block a user