[Persistence] Don't expect persist calls in RemoveAction spec
This commit is contained in:
@@ -37,7 +37,6 @@ define(
|
|||||||
mockGrandchildContext,
|
mockGrandchildContext,
|
||||||
mockRootContext,
|
mockRootContext,
|
||||||
mockMutation,
|
mockMutation,
|
||||||
mockPersistence,
|
|
||||||
mockType,
|
mockType,
|
||||||
actionContext,
|
actionContext,
|
||||||
model,
|
model,
|
||||||
@@ -53,8 +52,6 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
|
|
||||||
|
|
||||||
mockDomainObject = jasmine.createSpyObj(
|
mockDomainObject = jasmine.createSpyObj(
|
||||||
"domainObject",
|
"domainObject",
|
||||||
[ "getId", "getCapability" ]
|
[ "getId", "getCapability" ]
|
||||||
@@ -88,7 +85,6 @@ define(
|
|||||||
mockGrandchildContext = jasmine.createSpyObj("context", [ "getParent" ]);
|
mockGrandchildContext = jasmine.createSpyObj("context", [ "getParent" ]);
|
||||||
mockRootContext = jasmine.createSpyObj("context", [ "getParent" ]);
|
mockRootContext = jasmine.createSpyObj("context", [ "getParent" ]);
|
||||||
mockMutation = jasmine.createSpyObj("mutation", [ "invoke" ]);
|
mockMutation = jasmine.createSpyObj("mutation", [ "invoke" ]);
|
||||||
mockPersistence = jasmine.createSpyObj("persistence", [ "persist" ]);
|
|
||||||
mockType = jasmine.createSpyObj("type", [ "hasFeature" ]);
|
mockType = jasmine.createSpyObj("type", [ "hasFeature" ]);
|
||||||
mockNavigationService = jasmine.createSpyObj(
|
mockNavigationService = jasmine.createSpyObj(
|
||||||
"navigationService",
|
"navigationService",
|
||||||
@@ -109,7 +105,6 @@ define(
|
|||||||
|
|
||||||
capabilities = {
|
capabilities = {
|
||||||
mutation: mockMutation,
|
mutation: mockMutation,
|
||||||
persistence: mockPersistence,
|
|
||||||
type: mockType
|
type: mockType
|
||||||
};
|
};
|
||||||
model = {
|
model = {
|
||||||
@@ -118,7 +113,7 @@ define(
|
|||||||
|
|
||||||
actionContext = { domainObject: mockDomainObject };
|
actionContext = { domainObject: mockDomainObject };
|
||||||
|
|
||||||
action = new RemoveAction(mockQ, mockNavigationService, actionContext);
|
action = new RemoveAction(mockNavigationService, actionContext);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("only applies to objects with parents", function () {
|
it("only applies to objects with parents", function () {
|
||||||
@@ -154,9 +149,6 @@ define(
|
|||||||
// Should have removed "test" - that was our
|
// Should have removed "test" - that was our
|
||||||
// mock domain object's id.
|
// mock domain object's id.
|
||||||
expect(result.composition).toEqual(["a", "b"]);
|
expect(result.composition).toEqual(["a", "b"]);
|
||||||
|
|
||||||
// Finally, should have persisted
|
|
||||||
expect(mockPersistence.persist).toHaveBeenCalled();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("removes parent of object currently navigated to", function () {
|
it("removes parent of object currently navigated to", function () {
|
||||||
@@ -214,4 +206,4 @@ define(
|
|||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user